diff options
| author | Michal Nasiadka <mnasiadka@gmail.com> | 2025-10-10 17:27:24 +0200 |
|---|---|---|
| committer | Michal Nasiadka <mnasiadka@gmail.com> | 2025-10-20 07:40:33 +0000 |
| commit | 5d51037d2a703e936a8345e2ab5897bde36a03b8 (patch) | |
| tree | f5bc028dfd51c23308f1f2eb157cf31228ae76ca | |
| parent | 2e5c62c31c89d0e992c640576f3b184903c6bf65 (diff) | |
| download | kolla-ansible-5d51037d2a703e936a8345e2ab5897bde36a03b8.tar.gz kolla-ansible-5d51037d2a703e936a8345e2ab5897bde36a03b8.zip | |
CI: Switch test-core-openstack.sh to Tempest run
Unfortunately that will lead to dropping DNS integration
tests for internal DNS, because neutron-tempest-plugin
does not have such tests.
Change-Id: Ic1e0a6643e67467a22e91d277a9947c027935f09
Signed-off-by: Michal Nasiadka <mnasiadka@gmail.com>
| -rw-r--r-- | roles/kolla-ansible-tempest/defaults/main.yml | 11 | ||||
| -rw-r--r-- | roles/kolla-ansible-tempest/tasks/main.yml | 49 | ||||
| -rw-r--r-- | tests/get_logs.sh | 2 | ||||
| -rw-r--r-- | tests/post.yml | 4 | ||||
| -rw-r--r-- | tests/pre.yml | 6 | ||||
| -rw-r--r-- | tests/run.yml | 32 | ||||
| -rw-r--r-- | tests/setup_disks.sh | 29 | ||||
| -rw-r--r-- | zuul.d/base.yaml | 1 | ||||
| -rw-r--r-- | zuul.d/scenarios/cephadm.yaml | 1 |
9 files changed, 79 insertions, 56 deletions
diff --git a/roles/kolla-ansible-tempest/defaults/main.yml b/roles/kolla-ansible-tempest/defaults/main.yml new file mode 100644 index 000000000..600059789 --- /dev/null +++ b/roles/kolla-ansible-tempest/defaults/main.yml @@ -0,0 +1,11 @@ +--- +kolla_ansible_tempest_packages: + - python-tempestconf + - tempest + +kolla_ansible_tempest_cirros_ver: "0.6.3" +kolla_ansible_tempest_exclude_regex: "" +kolla_ansible_tempest_packages_extra: [] +kolla_ansible_tempest_regex: "" + +post_upgrade: false diff --git a/roles/kolla-ansible-tempest/tasks/main.yml b/roles/kolla-ansible-tempest/tasks/main.yml new file mode 100644 index 000000000..4991340f9 --- /dev/null +++ b/roles/kolla-ansible-tempest/tasks/main.yml @@ -0,0 +1,49 @@ +--- +- name: Install required packages + ansible.builtin.pip: + name: "{{ kolla_ansible_tempest_packages + kolla_ansible_tempest_packages_extra }}" + virtualenv: "{{ kolla_ansible_venv_path }}" + virtualenv_command: "python3 -m venv" + +- name: Init tempest workspace + ansible.builtin.shell: + cmd: > + {{ kolla_ansible_venv_path }}/bin/tempest init tempest + >/tmp/logs/ansible/test-init-tempest 2>&1 + creates: "/home/zuul/tempest" + +- name: Discover tempest config + vars: + ver: "{{ kolla_ansible_tempest_cirros_ver }}" + image: "https://download.cirros-cloud.net/{{ ver }}/cirros-{{ ver }}-x86_64-disk.img" + ansible.builtin.shell: + chdir: "/home/zuul/tempest" + cmd: > + {{ kolla_ansible_venv_path }}/bin/discover-tempest-config + --debug + --image {{ image }} + --os-cloud kolla-admin + >/tmp/logs/ansible/test-init-tempest-discover 2>&1 + environment: + OS_CLIENT_CONFIG_FILE: "/etc/kolla/clouds.yaml" + +- name: Run tempest tests + environment: + OS_LOG_CAPTURE: "1" + OS_STDOUT_CAPTURE: "1" + OS_STDERR_CAPTURE: "1" + OS_TEST_TIMEOUT: "1200" + vars: + tempest_log_file: "test-tempest-run{{ '-post-upgrade' if post_upgrade | bool else '' }}" + ansible.builtin.shell: + chdir: "/home/zuul/tempest" + cmd: > + {{ kolla_ansible_venv_path }}/bin/tempest run + --config-file etc/tempest.conf + {% if kolla_ansible_tempest_regex | length > 0 %} + --regex '{{ kolla_ansible_tempest_regex }}' + {% endif %} + {% if kolla_ansible_tempest_exclude_regex | length > 0 %} + --exclude-regex '{{ kolla_ansible_tempest_exclude_regex }}' + {% endif %} + >/tmp/logs/ansible/{{ tempest_log_file }} 2>&1 diff --git a/tests/get_logs.sh b/tests/get_logs.sh index 8633ec1c3..db18de5cd 100644 --- a/tests/get_logs.sh +++ b/tests/get_logs.sh @@ -15,7 +15,7 @@ copy_logs() { echo "Invalid container engine: ${CONTAINER_ENGINE}" exit 1 fi - + cp -rL /home/zuul/tempest ${LOG_DIR}/ [ -d ${VOLUMES_DIR}/kolla_logs/_data ] && cp -rnL ${VOLUMES_DIR}/kolla_logs/_data/* ${LOG_DIR}/kolla/ [ -d /etc/kolla ] && cp -rnL /etc/kolla/* ${LOG_DIR}/kolla_configs/ # Don't save the IPA images. diff --git a/tests/post.yml b/tests/post.yml index 77dd25b61..4d9973750 100644 --- a/tests/post.yml +++ b/tests/post.yml @@ -2,6 +2,10 @@ - hosts: all vars: logs_dir: "/tmp/logs" + roles: + - role: fetch-subunit-output + zuul_work_dir: '/home/zuul/tempest' + tasks: # TODO(mhiner): Currently only Docker to Podman migration is tested. # If we want to test the other direction we have to rework this. diff --git a/tests/pre.yml b/tests/pre.yml index 4f8d4556d..1a666e97d 100644 --- a/tests/pre.yml +++ b/tests/pre.yml @@ -63,6 +63,12 @@ - python3-setuptools - python3-requests + - name: Install stestr + become: true + pip: + break_system_packages: true + name: stestr + - name: Install lvm on storage scenarios become: true package: diff --git a/tests/run.yml b/tests/run.yml index 08c7e4f40..7e9d71a77 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -425,16 +425,8 @@ CONTAINER_ENGINE: "{{ container_engine }}" IS_UPGRADE: "{{ is_upgrade | bool | ternary('yes', 'no') }}" - - name: Run test-core-openstack.sh script - script: - cmd: test-core-openstack.sh - executable: /bin/bash - chdir: "{{ kolla_ansible_src_dir }}" - environment: - SCENARIO: "{{ scenario }}" - HAS_UPGRADE: "{{ is_upgrade | bool | ternary('yes', 'no') }}" - PHASE: deploy - IP_VERSION: "{{ 6 if address_family == 'ipv6' else 4 }}" + - import_role: + name: kolla-ansible-tempest when: openstack_core_tested - name: Run test-zun.sh script @@ -729,22 +721,10 @@ name: kolla-ansible-test-dashboard when: dashboard_enabled - # NOTE(yoctozepto): We need the script module here to avoid - # a bug in Glance OSC [1][2] which results in a failure when a volume - # is given as a source. The stdin works differently in shell/command - # than script. - # [1] https://opendev.org/openstack/python-openstackclient/src/commit/6810414e45a32dd44263dff47fec161989508ef0/openstackclient/image/v2/image.py#L114-L120 - # [2] https://opendev.org/openstack/python-openstackclient/src/commit/6810414e45a32dd44263dff47fec161989508ef0/openstackclient/image/v2/image.py#L414 - - name: Run test-core-openstack.sh script (post upgrade) - script: - cmd: test-core-openstack.sh - executable: /bin/bash - chdir: "{{ kolla_ansible_src_dir }}" - environment: - SCENARIO: "{{ scenario }}" - HAS_UPGRADE: 'yes' - PHASE: upgrade - IP_VERSION: "{{ 6 if address_family == 'ipv6' else 4 }}" + - import_role: + name: kolla-ansible-tempest + vars: + post_upgrade: true when: openstack_core_tested - name: Run test-prometheus-opensearch.sh script (post-upgrade) diff --git a/tests/setup_disks.sh b/tests/setup_disks.sh deleted file mode 100644 index 6cd03ddc4..000000000 --- a/tests/setup_disks.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -# $1: scenario / ceph store type - -set -o xtrace -set -o errexit - -mkdir -p /opt/data/kolla - -if [ $1 = 'zun' ]; then - # create cinder-volumes volume group for cinder lvm backend - free_device=$(losetup -f) - fallocate -l 5G /var/lib/cinder_data.img - losetup $free_device /var/lib/cinder_data.img - pvcreate $free_device - vgcreate cinder-volumes $free_device -elif [ $1 = 'ceph-lvm' ]; then - free_device=$(losetup -f) - fallocate -l 5G /var/lib/ceph-osd1.img - losetup $free_device /var/lib/ceph-osd1.img - pvcreate $free_device - vgcreate cephvg $free_device - lvcreate -l 100%FREE -n cephlv cephvg -else - echo "Unknown type" >&2 - exit 1 -fi - -partprobe diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index 0a53f6df1..bae3aab5b 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -60,6 +60,7 @@ container_engine: "docker" is_upgrade: "{{ 'upgrade' in zuul.job }}" is_slurp: "{{ 'slurp' in zuul.job }}" + kolla_ansible_tempest_regex: "\\[.*\\bsmoke\\b.*\\]" kolla_internal_vip_address: "192.0.2.10" le_enabled: false neutron_external_bridge_name: br-0 diff --git a/zuul.d/scenarios/cephadm.yaml b/zuul.d/scenarios/cephadm.yaml index a9b1ac7ea..28ac2128b 100644 --- a/zuul.d/scenarios/cephadm.yaml +++ b/zuul.d/scenarios/cephadm.yaml @@ -12,6 +12,7 @@ kolla_ansible_setup_disks_file_path: "/var/lib/ceph-osd.img" kolla_ansible_setup_disks_vg_name: "cephvg" kolla_ansible_setup_disks_lv_name: "cephlv" + kolla_ansible_tempest_exclude_regex: "^tempest.api.object_storage" scenario: cephadm scenario_images_extra: - ^cinder |
