Merge "validate: Remove logic for unsupported old releases"

This commit is contained in:
Zuul 2023-01-31 12:45:17 +00:00 committed by Gerrit Code Review
commit 2f2f42f8f6
8 changed files with 11 additions and 180 deletions

View File

@ -79,11 +79,6 @@
python-virtualenv
{% endif %}
- name: Set the rc file
set_fact:
rc_file: "{{ (tempest_cloud_name in ['undercloud']) | ternary('stackrc', 'overcloudrc') }}"
when: release in ['queens', 'stein']
# FIXME(chandankumar): centos9 https://bugs.launchpad.net/tripleo/+bug/1953032/comments/5
# TODO(marios): centos8 https://bugs.launchpad.net/tripleo/+bug/1976247
- name: Disable stackviz for CentOS Stream 9 and 8
@ -91,53 +86,6 @@
tempest_run_stackviz: false
when: ansible_distribution_major_version is version('8', '>=')
- name: Create clouds.yaml if it doesn't exist
shell: |
# queens is returning //v3 so we replace with /v3
sed -i 's/\/\/v3/\/v3/g' {{ ansible_user_dir }}/{{ rc_file }}
source {{ ansible_user_dir }}/{{ rc_file }}
mkdir -p {{ ansible_user_dir }}/.config/openstack
cat <<EOF>>{{ ansible_user_dir }}/.config/openstack/clouds.yaml
clouds:
{{ tempest_cloud_name }}:
identity_api_version: $OS_IDENTITY_API_VERSION
region_name: regionOne
auth:
auth_url: $OS_AUTH_URL
password: $OS_PASSWORD
username: $OS_USERNAME
user_domain_name: Default
project_domain_name: Default
project_name: $OS_PROJECT_NAME
EOF
when:
- release in ['queens', 'stein']
- not tempest_cloud_name in ['standalone']
# Ansible requires openstacksdk>=0.12 do the resource setup, however
# queens upper-constraint has openstacksdk==0.11.36, so we need to
# implement a custom venv with the right openstacksdk to make it work
- name: Queens specific settings and tasks
when: release in ['queens']
vars:
sdk_venv_path: "{{ ansible_user_dir }}/.sdk"
block:
- name: Set tempest_service_setup_host_python_interpreter
set_fact:
tempest_service_setup_host_python_interpreter: "{{ sdk_venv_path }}/bin/python"
- name: Prepare openstacksdk venv
import_role:
name: "python_venv_build"
vars:
venv_python_executable: "{{ python_cmd }}"
venv_build_constraints:
- "--constraint https://releases.openstack.org/constraints/upper/rocky"
venv_install_destination_path: "{{ sdk_venv_path }}"
venv_pip_packages:
- 'openstacksdk'
venv_wheel_build_enable: false
# This will execute os_tempest
- name: Execute os_tempest
when: use_os_tempest | default(true)
@ -188,9 +136,8 @@
tempest_public_subnet_cidr: '{{ tempest_cidr }}'
tempest_public_subnet_gateway_ip: '{{ tempest_cidr|nthhost(1) }}'
tempest_public_subnet_allocation_pools: '{{ tempest_cidr|nthhost(150) ~ "-" ~ tempest_cidr|nthhost(200) }}'
tempest_private_net_seg_id: "{{ (release in ['queens']) | ternary('', omit) }}"
tempest_network_ping_gateway: "{{ tempest_ping_router|default(true)|bool }}"
tempest_private_net_provider_type: "{{ (release in ['queens']) | ternary('vlan', 'geneve') }}"
tempest_private_net_provider_type: 'geneve'
tempest_private_net_create: true
tempest_router_create: true
when: tempest_cidr is defined

View File

@ -61,12 +61,7 @@ tempest_whitelist_file: "whitelist_file.conf"
tempest_whitelist: []
tempest_log_dir: "/var/log/tempest"
tempest_log_file: "tempest.log"
tempest_plugins: >-
{% if release not in ['newton', 'ocata', 'pike'] -%}
[ "python-keystone-tests-tempest", "python-neutron-tests-tempest" ]
{%- else -%}
[ "python-keystone-tests", "python-neutron-tests" ]
{%- endif -%}
tempest_plugins: ["python-keystone-tests-tempest", "python-neutron-tests-tempest"]
tempest_plugins_git: []
tempest_extra_config: {} # A dict containing values which needs to be overridden in tempest.conf
skip_file_src: "skip_file.j2"
@ -76,13 +71,9 @@ tempest_exit_on_failure: true
# Set tempest_version for different release
# For forked-tempest, we have branched name in synced with releases.
tempest_version_dict:
newton: 'newton'
ocata: '16.1.0'
pike: '17.1.0'
queens: '17.2.0'
master: 'master'
tempest_version: "{{ tempest_version_dict[release] }}"
tempest_conf_version_dict: {'ocata': '1.1.3', 'pike': '1.1.3', 'queens': '1.1.4', 'master': 'master'}
tempest_conf_version_dict: {'master': 'master'}
tempest_conf_version: "{{ tempest_conf_version_dict[release] }}"
tempestmail_config: config.yaml
tempestmail_log_server: http://logs.openstack.org
@ -91,19 +82,7 @@ tempest_test_image_version: 0.5.2
tempest_test_image_name: cirros-{{ tempest_test_image_version }}-x86_64-disk.img
tempest_test_image_path: http://download.cirros-cloud.net/{{ tempest_test_image_version }}/{{ tempest_test_image_name }}
# A dict containing values to be removed from tempest.conf
tempest_conf_removal: >-
{% if release in ['queens'] -%}
{{ tempest_conf_removal_queens }}
{%- else -%}
{{ tempest_conf_removal_all }}
{%- endif -%}
tempest_conf_removal_all:
network-feature-enabled.api_extensions: dvr
tempest_conf_removal_queens:
volume.min_microversion: 3.0
volume.max_microversion: 3.50
tempest_conf_removal:
network-feature-enabled.api_extensions: dvr
tempest_os_cloud: ""
stackviz_tarball: "https://tarballs.opendev.org/openstack/stackviz/dist/stackviz-latest.tar.gz"

View File

@ -70,7 +70,7 @@
package:
name: "{{ python_package_prefix }}-stestr"
state: present
when: tempest_format in ['container', 'packages'] and release not in ['newton', 'ocata']
when: tempest_format in ['container', 'packages']
- ignore_errors: true
block:

View File

@ -1,22 +1,4 @@
---
- name: Install openstack services tempest plugin for newton
package:
name:
- python-ceilometer-tests
- python-zaqar-tests
- python-ironic-inspector-tests
- python-gnocchi-tests
- python-aodh-tests
- python-mistral-tests
- python-heat-tests
- python-keystone-tests
- python-ironic-tests
- python-neutron-tests
- python-cinder-tests
state: present
become: true
when: release == 'newton'
- name: Install openstack services tempest plugins
# noqa 403
package:
@ -39,12 +21,11 @@
name: "{{ python_package_prefix }}-tempestconf"
state: present
become: true
when: release != 'newton'
- name: Set tempest init command
set_fact:
tempest_init: "{% if release == 'newton' %}/usr/share/openstack-tempest-*/tools/configure-tempest-directory{% else %}tempest init {{ tempest_dir }}{% endif %}"
tempest_init: "tempest init {{ tempest_dir }}"
- name: Set tempestconf call
set_fact:
tempestconf: "{% if release == 'newton' %}{{ tempest_dir }}/tools/config_tempest.py{% else %}/usr/bin/discover-tempest-config{% endif %}"
tempestconf: "/usr/bin/discover-tempest-config"

View File

@ -1,24 +1,15 @@
---
- name: Cloning tempest from redhat-openstack repository
git:
repo: 'https://github.com/redhat-openstack/tempest.git'
dest: '{{ working_dir }}/tempest_git'
version: '{{ tempest_version }}'
when: release == 'newton'
- name: Cloning tempest from openstack repository
git:
repo: 'https://opendev.org/openstack/tempest'
dest: '{{ working_dir }}/tempest_git'
version: '{{ tempest_version }}'
when: release != 'newton'
- name: Cloning python-tempestconf
git:
repo: 'https://opendev.org/openinfra/python-tempestconf'
dest: '{{ working_dir }}/tempestconf_git'
version: '{{ tempest_conf_version }}'
when: release != 'newton'
- name: Check if virtualenv is in the system
command: "{{ python_cmd }} -m virtualenv --version"
@ -56,9 +47,9 @@
- name: Set tempest init command
set_fact:
tempest_init: "{{ working_dir }}/tempest_git/tools/{% if release == 'newton' %}configure-tempest-directory{% else %}with_venv.sh tempest init{% endif %}"
tempest_init: "{{ working_dir }}/tempest_git/tools/with_venv.sh tempest init"
- name: Set tempestconf call
set_fact:
tempestconf: >
{% if release == 'newton' %}{{ working_dir }}/tools/config_tempest.py{% else %}{{ working_dir }}/tempest_git/tools/with_venv.sh discover-tempest-config{% endif %}
{{ working_dir }}/tempest_git/tools/with_venv.sh discover-tempest-config

View File

@ -1,38 +1,3 @@
{% if release == 'newton' %}
for i in $(neutron floatingip-list -c id -f value)
do
neutron floatingip-disassociate $i
neutron floatingip-delete $i
done
for i in $(neutron router-list -c id -f value); do neutron router-gateway-clear $i; done
for r in $(neutron router-list -c id -f value); do
for p in $(neutron router-port-list $r -c id -f value); do
neutron router-interface-delete $r port=$p || true
done
done
for i in $(neutron router-list -c id -f value); do neutron router-delete $i; done
for i in $(neutron port-list -c id -f value); do neutron port-delete $i; done
for i in $(neutron net-list -c id -f value); do neutron net-delete $i; done
neutron net-create {{ public_net_name }} --router:external=True \
{% if public_physical_network != '' %}
--provider:network_type {{ public_network_type }} \
{% if public_segmentation_id != '' %}
--provider:segmentation_id {{ public_segmentation_id }} \
{% endif %}
--provider:physical_network {{ public_physical_network }}
{% endif %}
neutron subnet-create --name ext-subnet \
--allocation-pool \
start={{ public_net_pool_start }},end={{ public_net_pool_end }} \
--disable-dhcp \
--gateway {{ public_net_gateway }} \
{{ public_net_name }} {{ floating_ip_cidr }}
{% else %}
for i in $(openstack floating ip list -c ID -f value)
do
openstack floating ip unset --port $i
@ -96,4 +61,3 @@ openstack subnet create ext-subnet \
--network {{ public_net_name }} \
--subnet-range {{ floating_ip_cidr }}
{% endif %}
{% endif %}

View File

@ -65,10 +65,8 @@ virtualenv --system-site-packages {{ working_dir }}/tempest_git/.venv
{% endfor %}
# Install python-tempestconf
{% if release != 'newton'%}
{{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/tempestconf_git
{% endif %}
{% endif %}
{% if tempest_format == "container" %}
echo "========= Note: Executing tempest via a container =========="
@ -120,32 +118,23 @@ export TEMPESTCONF="{{ tempestconf }}"
{% if tempest_overcloud|bool or tempest_os_cloud != '' %}
# Get public net id
{% if release == 'newton' %}
public_net_id=$(neutron net-show {{ public_net_name }} -f value -c id)
{% else %}
{% if ironic_overcloud|default(false)|bool %}
public_net_id=$(openstack network show provisioning -f value -c id)
{% else %}
public_net_id=$(openstack network show {{ public_net_name }} -f value -c id)
{% endif %}
{% endif %}
{% endif %}
region_name=${OS_REGION_NAME:-'regionOne'}
{% if not tempest_overcloud|bool %}
# query the endpoint if not set (e.g. clouds.yaml)
export OS_AUTH_URL=${OS_AUTH_URL:-$(openstack endpoint list --service=identity --interface=public -c URL -f value)}
{% if release not in ['newton', 'ocata'] %}
# set the itentity api version if not set (e.g. clouds.yaml)
export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3}
# OS_AUTH_URL does not contains identity api version in stackrc from
# Pike onwards.
export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION"
{% elif release == 'pike' %}
# Use Identity version v2.0 for pike
export OS_AUTH_URL="$OS_AUTH_URL/v2.0"
{% endif %}
{% endif %}
# Generate Tempest Config file using python-tempestconf
# Notice aodh_plugin will be set to False if telemetry service is disabled
@ -172,24 +161,8 @@ $TEMPESTCONF --out etc/tempest.conf \
DEFAULT.log_file {{ tempest_log_file }} \
{% endif %}
identity.region $region_name \
{% if release in ['newton', 'ocata', 'pike'] %}
identity.uri $OS_AUTH_URL \
identity.admin_password $OS_PASSWORD \
identity.admin_username $OS_USERNAME \
identity.disable_ssl_certificate_validation true \
compute.allow_tenant_isolation true \
scenario.img_file {{ tempest_test_image_name }} \
{% else %}
auth.use_dynamic_credentials true \
network-feature-enabled.port_security true \
{% endif %}
{% if release in ['queens'] %}
compute-feature-enabled.scheduler_available_filters RetryFilter,AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,PciPassthroughFilter \
{% endif %}
{% if release in ['newton', 'ocata', 'pike', 'queens'] %}
compute-feature-enabled.attach_encrypted_volume False \
compute-feature-enabled.console_output true \
{% endif %}
network.tenant_network_cidr {{ tenant_network_cidr }} \
compute.build_timeout 500 \
network.build_timeout 500 \

View File

@ -26,9 +26,9 @@ $TEMPESTCLI list-plugins
$TEMPESTCLI cleanup --init-saved-state
{% endif %}
{% if release in ["newton", "ocata", "pike"] %} $OSTESTR {% else %} $TEMPESTCLI run {% endif %}{% if test_white_regex != '' %} --regex '({{ test_white_regex }})' {% endif %}
$TEMPESTCLI run {% if test_white_regex != '' %} --regex '({{ test_white_regex }})' {% endif %}
{% if tempest_whitelist|length > 0 %} --whitelist_file=$TEMPESTDATA/{{ tempest_whitelist_file }} {% endif %}
{% if release not in ["newton", "ocata", "pike"] %} {% if test_black_regex|length > 0 %} --black-regex='{{ test_black_regex|join('|') }}'{% endif %} {% endif %}
{% if test_black_regex|length > 0 %} --black-regex='{{ test_black_regex|join('|') }}'{% endif %}
{% if skip_file_src != '' %} --blacklist_file=$TEMPESTDATA/{{ skip_file }} {% endif %}
{% if tempest_workers is defined %} --concurrency {{ tempest_workers }} {% endif %}
{% if tempest_until_failure|bool %} --until-failure {% endif %}
@ -72,11 +72,7 @@ sudo cp \
sudo cp -Rf {{ working_dir }}/.config $TEMPEST_HOST_DATA
{% endif %}
{% if release not in ['newton', 'ocata', 'pike', 'queens'] %}
export CONTAINER_BINARY='podman'
{% else %}
export CONTAINER_BINARY='docker'
{% endif %}
sudo $CONTAINER_BINARY pull {{ tempest_container_registry }}/{{ tempest_container_namespace }}:{{ tempest_container_tag }}