Download ubuntu images prior to pytest execution
Tobiko downloads images from their URL when their test need to upload them to glance In some cases this is problematic because some of those images are big and there may be timeouts affecting the tests With this patch, tobiko downloads the ubuntu-minimal image before the tobiko tests are executed (during the execution of the ansible/infrared tobiko roles), which should avoid timeouts during the test execution The intention is to extend this patch to other images such as CentOS, RHEL and Fedora NOTE: this patch does not modify the tests, it just adds the role so that the Ubuntu images are downloaded - a later patch will modify the tests so that they stop downloading the images and find them in the configured path instead Change-Id: Ifff8214b7d4a3c2a78d97b171714090fd64d60dd
This commit is contained in:
parent
78275eef4c
commit
4ad11e3710
@ -66,6 +66,9 @@
|
||||
- name: apply pre-requisites before tests run
|
||||
include_role: name=tobiko-ir-before-run
|
||||
|
||||
- name: "download images"
|
||||
include_role: name=tobiko-download-images
|
||||
|
||||
- name: "initialize test execution"
|
||||
include_role: name=tobiko-configure
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
- hosts: primary
|
||||
roles:
|
||||
- tobiko-zuul
|
||||
- tobiko-download-images
|
||||
- tobiko-configure
|
||||
- ci-common-vars
|
||||
- run-test
|
||||
|
@ -53,3 +53,10 @@ test_log_file: '{{ test_report_dir | realpath }}/tobiko.log'
|
||||
|
||||
# Local where test cases results are being collected to
|
||||
test_collect_dir: '{{ test_src_dir | realpath }}/{{ test_report_name }}'
|
||||
|
||||
# --- download-images options -------------------------------------------------
|
||||
download_images_dir: "{{ ansible_user_dir }}/.downloaded-images"
|
||||
download_images:
|
||||
ubuntu-minimal:
|
||||
type: ubuntu
|
||||
url: "https://cloud-images.ubuntu.com/minimal/releases/jammy/release/ubuntu-22.04-minimal-cloudimg-amd64.img"
|
||||
|
@ -21,6 +21,11 @@
|
||||
value: "{{ value }}"
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for file_name, dict_value in download_images.items() %}
|
||||
- section: "{{ dict_value.type }}"
|
||||
option: image_file
|
||||
value: "{{ download_images_dir }}/{{ file_name }}"
|
||||
{% endfor %}
|
||||
vars:
|
||||
sections: "{{ test_default_conf | combine(test_conf, recursive=True) }}"
|
||||
|
||||
|
4
roles/tobiko-download-images/meta/main.yaml
Normal file
4
roles/tobiko-download-images/meta/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: tobiko-common
|
15
roles/tobiko-download-images/tasks/main.yaml
Normal file
15
roles/tobiko-download-images/tasks/main.yaml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: create directory to store images
|
||||
file:
|
||||
state: directory
|
||||
dest: "{{ download_images_dir }}"
|
||||
|
||||
- name: download images
|
||||
get_url:
|
||||
dest: "{{ download_images_dir }}/{{ item.key }}"
|
||||
url: "{{ item.value.url }}"
|
||||
register: download
|
||||
retries: 5
|
||||
until: download is success
|
||||
with_dict: "{{ download_images }}"
|
Loading…
x
Reference in New Issue
Block a user