Commit 747295bd authored by Jérome Perrin's avatar Jérome Perrin

deploy-test: pre-download some images that we use in most test suites

Instead of downloading the image every time before running the test
we pre-download all images during the software installation. This
prevents downloading ~2Go every time, which is sometimes too long for
the slapos node instance step.
parent 70293831
Pipeline #23642 passed with stage
...@@ -18,4 +18,4 @@ md5sum = 8357771b70efd0740561b1cb46f6955e ...@@ -18,4 +18,4 @@ md5sum = 8357771b70efd0740561b1cb46f6955e
[template-deploy-test] [template-deploy-test]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 062e677990ca0cd0c0396993c58b46a2 md5sum = 1faa52013b12b1753bcaff0b1309ad90
...@@ -30,8 +30,8 @@ sla-computer_guid = ${slap-connection:computer-id} ...@@ -30,8 +30,8 @@ sla-computer_guid = ${slap-connection:computer-id}
# Tested image # Tested image
# Passed by request # Passed by request
config-virtual-hard-drive-url = {{ slapparameter_dict.get('image-to-test-url') }} config-virtual-hard-drive-url = ${image-to-test:url}
config-virtual-hard-drive-md5sum = {{ slapparameter_dict.get('image-to-test-md5sum') }} config-virtual-hard-drive-md5sum = ${image-to-test:md5sum}
# The test script # The test script
config-bootstrap-script-url = {{ in_vm_test_script }}#{{ in_vm_test_script_md5 }} config-bootstrap-script-url = {{ in_vm_test_script }}#{{ in_vm_test_script_md5 }}
...@@ -58,6 +58,24 @@ return = ...@@ -58,6 +58,24 @@ return =
nat-rule-port-tcp-443 nat-rule-port-tcp-443
nat-rule-port-tcp-80 nat-rule-port-tcp-80
[image-to-test]
# This section tries to replace the download URL by the file:// URL of an already downloaded image
recipe = slapos.recipe.build
init =
options['url'] = options['input-url']
for md5sum, url in self.buildout['image-repository'].items():
if md5sum == options['md5sum']:
print("Using pre-downloaded image", url)
options['url'] = url
break
input-url = {{ slapparameter_dict.get('image-to-test-url') }}
md5sum = {{ slapparameter_dict.get('image-to-test-md5sum') }}
[image-repository]
{% for md5sum, url in test_image_repository.items() %}
{{ md5sum }} = file://{{ url }}
{% endfor %}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory} home = ${buildout:directory}
......
...@@ -50,3 +50,10 @@ context = ...@@ -50,3 +50,10 @@ context =
raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum} raw in_vm_test_script_md5 ${deploy-script-controller-script:md5sum}
raw waittime ${deploy-script-controller-script:waittime} raw waittime ${deploy-script-controller-script:waittime}
raw tries ${deploy-script-controller-script:tries} raw tries ${deploy-script-controller-script:tries}
section test_image_repository test-image-repository
[test-image-repository]
${download-image-debian-9:md5sum} = ${download-image-debian-9:target}
${download-image-debian-10:md5sum} = ${download-image-debian-10:target}
${download-image-debian-11:md5sum} = ${download-image-debian-11:target}
...@@ -56,5 +56,24 @@ recipe = slapos.recipe.template ...@@ -56,5 +56,24 @@ recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg output = ${buildout:directory}/template.cfg
[download-image]
recipe = slapos.recipe.build:download
shared = true
[download-image-debian-9]
<= download-image
url = http://bit.ly/2IRi8Kg
md5sum = 2b113e3cd8276b9740189622603d6f99
[download-image-debian-10]
<= download-image
url = http://shacache.org/shacache/9d3e6d017754fdd08e5ecf78093dec27fd792fb183df6146006adf003b6f4b98c0388d5a11566627101f7855d77f60e3dd4ba7ce66850f4a8f030573b904d5ab
md5sum = b7928d7b0a2b5e2888f5ddf68f5fe422
[download-image-debian-11]
<= download-image
url = http://shacache.org/shacache/476c96feff4bc44950e8ccf05d703d973f6d60c5ab95c8724cc4096cb008b3f904708a2377c293bf73758914d2d4556a31a056b0f33cae11ed48194019fdab4c
md5sum = e58dbfd8637d73f7ccd473ad16da852a
[versions] [versions]
erp5.util = 0.4.69 erp5.util = 0.4.69
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment