From 2c847b53cbbaee5801c549c98b160f9b8c7786ae Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 7 Sep 2018 18:35:42 +0100 Subject: [PATCH] Clean up role tests Now that we're using the general templates, we can slim down the role test definitions. We can also remove tests which are not being watched, or which are fundamentally broken. With this we can also remove unused scripts/plays. We do the following: 1. We remove the 'ssl' job, given that the person working on that is no longer doing so, and no-one else has picked up the work. 2. We remove the 'upgrade' job, given that it's been broken all cycle due to the way the job executes and we need to regroup to figure out another way to do it. 3. We promote the jobs which appear to be reliably working. 4. We rename the tox target for 'func_ovs' to 'ovs' and 'func_ovn' to 'ovn' as the 'fun_' prefix is pointless. 5. We rename the '-nv' jobs to without that suffix, and move the non-voting argument to the projects file to make it more obvious and easier to change later. Change-Id: Ic2f8a999cc084da76fade0000d2e6198b025c38a --- tests/ansible-role-requirements.yml | 4 - tests/benchmark-upgrade.yml | 20 ----- tests/test-install-previous-neutron.yml | 98 --------------------- tests/test-neutron-resources-results.yml | 30 ------- tests/test-neutron-resources-upgrade.yml | 58 ------------- tests/test-neutron-upgrades.sh | 105 ----------------------- tests/test-upgrade.yml | 31 ------- tox.ini | 24 ++---- zuul.d/jobs.yaml | 34 ++------ zuul.d/project.yaml | 26 +++--- 10 files changed, 33 insertions(+), 397 deletions(-) delete mode 100644 tests/benchmark-upgrade.yml delete mode 100644 tests/test-install-previous-neutron.yml delete mode 100644 tests/test-neutron-resources-results.yml delete mode 100644 tests/test-neutron-resources-upgrade.yml delete mode 100755 tests/test-neutron-upgrades.sh delete mode 100644 tests/test-upgrade.yml diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index 1529c4c3..4fb80ed1 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -55,10 +55,6 @@ scm: git src: https://github.com/logan2211/ansible-etcd version: master -- name: os_previous_neutron - src: https://git.openstack.org/openstack/openstack-ansible-os_neutron - scm: git - version: stable/queens - name: opendaylight scm: git src: https://github.com/opendaylight/integration-packaging-ansible-opendaylight diff --git a/tests/benchmark-upgrade.yml b/tests/benchmark-upgrade.yml deleted file mode 100644 index 78dc2e20..00000000 --- a/tests/benchmark-upgrade.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Copyright 2017, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- import_playbook: test-neutron-resources-upgrade.yml - -- import_playbook: common/test-install-neutron.yml - -- import_playbook: test-neutron-resources-results.yml diff --git a/tests/test-install-previous-neutron.yml b/tests/test-install-previous-neutron.yml deleted file mode 100644 index fe24ce50..00000000 --- a/tests/test-install-previous-neutron.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -# Copyright 2016, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- import_playbook: common/setting-nodepool-variables.yml - -# Ensure the repo is setup for previous version -- import_playbook: common/previous/test-repo-setup.yml - -- name: Make /lib/modules accessible on neutron_agent containers - hosts: neutron_agent - user: root - become: true - gather_facts: true - tasks: - - name: Use the unconfined aa profile - lxc_container: - name: "{{ container_name }}" - container_config: "{{ lxc_container_config_list }}" - delegate_to: "{{ physical_host }}" - - - name: Set mount path for kernel modules (Ubuntu) - set_fact: - kernel_module_path: "lib/modules" - when: ansible_pkg_mgr == 'apt' - - - name: Set mount path for kernel modules (CentOS) - set_fact: - kernel_module_path: "usr/lib/modules" - when: ansible_pkg_mgr in ['yum', 'dnf'] - - - name: Neutron extra lxc config - lxc_container: - name: "{{ container_name }}" - container_command: | - [[ ! -d "/{{ kernel_module_path }}" ]] && mkdir -p "/{{ kernel_module_path }}" - container_config: - - "lxc.cgroup.devices.allow=a *:* rmw" - - "lxc.mount.entry=/{{ kernel_module_path }} {{ kernel_module_path }} none bind 0 0" - delegate_to: "{{ physical_host }}" - - - name: Wait for ssh to be available - local_action: - module: wait_for - port: "{{ ansible_port | default('22') }}" - host: "{{ ansible_host | default(inventory_hostname) }}" - search_regex: OpenSSH - delay: 1 - - name: Ensure presence of iptables inside the agent before running the role - package: - name: iptables - state: present - -- name: Deploy neutron - hosts: neutron_all - user: root - gather_facts: true - pre_tasks: - # NOTE: These are typically installed in the repo server where we build the - # neutron wheel - - name: Install packages required to build neutron python package (Ubuntu) - apt: - name: "{{ item }}" - with_items: - - libffi-dev - when: - - inventory_hostname in groups['neutron_all'] - - ansible_pkg_mgr == 'apt' - - name: Install packages required to build neutron python package (CentOS) - yum: - name: "{{ item }}" - with_items: - - libffi-devel - when: - - inventory_hostname in groups['neutron_all'] - - ansible_pkg_mgr in ['yum', 'dnf'] - - include_tasks: common/ensure-rabbitmq.yml - vhost_name: "{{ neutron_rabbitmq_vhost }}" - user_name: "{{ neutron_rabbitmq_userid }}" - user_password: "{{ neutron_rabbitmq_password }}" - - include_tasks: common/create-grant-db.yml - db_name: "{{ neutron_galera_database }}" - db_password: "{{ neutron_container_mysql_password }}" - roles: - - role: "os_previous_neutron" - vars_files: - - common/previous/test-vars.yml diff --git a/tests/test-neutron-resources-results.yml b/tests/test-neutron-resources-results.yml deleted file mode 100644 index 1c3c97cd..00000000 --- a/tests/test-neutron-resources-results.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# Copyright 2017, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Playbook to report resource tests - hosts: localhost - user: root - gather_facts: no - tasks: - - name: Kill resource test - command: pkill -f rolling_test - ignore_errors: yes - - name: Register upgrade benchmarking results - async_status: jid={{ rolling_test_benchmark.ansible_job_id }} - register: rolling_test_benchmark_results - until: rolling_test_benchmark_results.finished - - name: Display basic summary - debug: - msg: "Finished upgrade with {{ rolling_test_benchmark_results.stdout }}% API response failure rate" diff --git a/tests/test-neutron-resources-upgrade.yml b/tests/test-neutron-resources-upgrade.yml deleted file mode 100644 index 6defc8db..00000000 --- a/tests/test-neutron-resources-upgrade.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -# Copyright 2017, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Playbook to run resource tests against an openstack service - hosts: localhost - user: root - become: true - vars: - working_dir: "{{ lookup('env', 'WORKING_DIR') }}" - upgrade_venv_folder: "/openstack/venvs/upgrades" - upgrade_test_packages: - - "python-keystoneclient" - - "python-glanceclient" - - "openstacksdk" - tasks: - - name: Lay clouds.yaml - include_role: - name: openstack_openrc - - name: Install openstack sdk - pip: - name: "{{ upgrade_test_packages }}" - virtualenv: "{{ upgrade_venv_folder }}" - virtualenv_site_packages: "no" - extra_args: >- - {{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }} - {{ pip_install_options | default('') }} - register: install_packages - until: install_packages is success - retries: 5 - delay: 2 - - - name: Run rolling test script - shell: | - source {{ upgrade_venv_folder }}/bin/activate - ./openstack-ansible-ops/bowling_ball/rolling_tests.py neutron - args: - chdir: "{{ working_dir }}" - executable: /bin/bash - async: 100000 - poll: 0 - environment: - OS_AUTH_URL: "{{ keystone_service_publicurl }}" - OS_PASSWORD: "{{ keystone_auth_admin_password }}" - register: rolling_test_benchmark - vars_files: - - common/test-vars.yml diff --git a/tests/test-neutron-upgrades.sh b/tests/test-neutron-upgrades.sh deleted file mode 100755 index e1848d7a..00000000 --- a/tests/test-neutron-upgrades.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2016, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# WARNING: -# This file is use by all OpenStack-Ansible roles for testing purposes. -# Any changes here will affect all OpenStack-Ansible role repositories -# with immediate effect. - -# PURPOSE: -# This script executes test Ansible playbooks required for performing -# an upgrade test of the os_neutron role. - -## Shell Opts ---------------------------------------------------------------- - -set -e - -## Vars ---------------------------------------------------------------------- - -export WORKING_DIR=${WORKING_DIR:-$(pwd)} -export ROLE_NAME=${ROLE_NAME:-''} - -export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-"-vv"} -export ANSIBLE_OVERRIDES=${ANSIBLE_OVERRIDES:-$WORKING_DIR/tests/os_neutron-overrides.yml} -export TEST_PLAYBOOK=${TEST_PLAYBOOK:-$WORKING_DIR/tests/test-upgrade.yml} -export TEST_CHECK_MODE=${TEST_CHECK_MODE:-false} -export TEST_IDEMPOTENCE=${TEST_IDEMPOTENCE:-false} - -export COMMON_TESTS_PATH="${WORKING_DIR}/tests/common" - -echo "ANSIBLE_OVERRIDES: ${ANSIBLE_OVERRIDES}" -echo "ANSIBLE_PARAMETERS: ${ANSIBLE_PARAMETERS}" -echo "TEST_PLAYBOOK: ${TEST_PLAYBOOK}" -echo "TEST_CHECK_MODE: ${TEST_CHECK_MODE}" -echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}" - -## Functions ----------------------------------------------------------------- - -function execute_ansible_playbook { - - export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS} -e @${ANSIBLE_OVERRIDES}" - export ANSIBLE_BIN=${ANSIBLE_BIN:-"ansible-playbook"} - CMD_TO_EXECUTE="${ANSIBLE_BIN} ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}" - - echo "Executing: ${CMD_TO_EXECUTE}" - echo "With:" - echo " ANSIBLE_INVENTORY: ${ANSIBLE_INVENTORY}" - echo " ANSIBLE_LOG_PATH: ${ANSIBLE_LOG_PATH}" - - ${CMD_TO_EXECUTE} - -} - -## Main ---------------------------------------------------------------------- - -# Ensure that the Ansible environment is properly prepared -source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh" - -# Prepare environment for the initial deploy of (previous and current) Neutron -# No upgrading or testing is done yet. -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-newton-neutron-install.log" - -# Execute the setup of current infrastructure -execute_ansible_playbook - -# Prepare environment for the deploy of previous Nova: -# No upgrading or testing is done yet. -export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-neutron.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_neutron-install.log" -export PREVIOUS_VENV="ansible-previous" -export ANSIBLE_BIN="${WORKING_DIR}/.tox/${PREVIOUS_VENV}/bin/ansible-playbook" -source ${COMMON_TESTS_PATH}/test-create-previous-venv.sh - -# Execute the setup of previous Neutron -execute_ansible_playbook - -# Unset previous branch overrides -unset PREVIOUS_VENV -unset ANSIBLE_BIN - -# Prepare environment for the upgrade of Neutron -export TEST_PLAYBOOK="${WORKING_DIR}/tests/benchmark-upgrade.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-newton-upgrade.log" - -# Excute the upgrade of Neutron -execute_ansible_playbook - -# Prepare the environment for the testing of upgraded Neutron -export TEST_PLAYBOOK="${COMMON_TESTS_PATH}/test-install-tempest.yml" -export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-newton-upgrade-test.log" - -# Execute testing of upgraded Neutron -execute_ansible_playbook diff --git a/tests/test-upgrade.yml b/tests/test-upgrade.yml deleted file mode 100644 index 62db6b7b..00000000 --- a/tests/test-upgrade.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -# Copyright 2015, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Setup the user ssh keys, host and containers -- import_playbook: common/test-setup-host.yml - -# Install haproxy -- import_playbook: common/test-install-haproxy.yml - -# Install RabbitMQ/MariaDB -- import_playbook: common/test-install-infra.yml - -# Install etcd -- import_playbook: common/test-install-etcd.yml - when: - - groups['neutron_calico_dhcp_agent'] | length > 0 - -# Install Keystone -- import_playbook: common/test-install-keystone.yml diff --git a/tox.ini b/tox.ini index 3f698c32..eb0a04a4 100644 --- a/tox.ini +++ b/tox.ini @@ -92,6 +92,7 @@ commands = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:distro_install] setenv = {[testenv]setenv} @@ -99,14 +100,8 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:upgrade] -setenv = - {[testenv]setenv} - CLONE_UPGRADE_TESTS=yes -commands = - bash -c "{toxinidir}/tests/test-neutron-upgrades.sh" -[testenv:func_ovs] +[testenv:ovs] setenv = {[testenv]setenv} ANSIBLE_INVENTORY={toxinidir}/tests/ovs_inventory @@ -123,6 +118,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:dragonflow] setenv = {[testenv]setenv} @@ -131,6 +127,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:opendaylight] setenv = {[testenv]setenv} @@ -139,6 +136,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:opendaylight-bgpvpn] setenv = {[testenv]setenv} @@ -147,6 +145,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:ovs-nsh] setenv = {[testenv]setenv} @@ -155,7 +154,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:func_ovn] +[testenv:ovn] setenv = {[testenv]setenv} ANSIBLE_INVENTORY={toxinidir}/tests/ovn_inventory @@ -163,6 +162,7 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" + [testenv:odl-sfc] setenv = {[testenv]setenv} @@ -172,14 +172,6 @@ commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:ssl] -setenv = - {[testenv]setenv} - ANSIBLE_PARAMETERS=-vvv -e galera_use_ssl=True -commands = - bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" - - [testenv:linters] commands = bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh" diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 2300a067..194a5264 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -14,71 +14,55 @@ # limitations under the License. - job: - name: openstack-ansible-ovs-ubuntu-xenial-nv + name: openstack-ansible-ovs-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: - tox_env: func_ovs + tox_env: ovs - job: - name: openstack-ansible-ovn-ubuntu-xenial-nv + name: openstack-ansible-ovn-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: - tox_env: func_ovn + tox_env: ovn - job: - name: openstack-ansible-ovn-centos-7-nv + name: openstack-ansible-ovn-centos-7 parent: openstack-ansible-functional-centos-7 - voting: false vars: - tox_env: func_ovn + tox_env: ovn - job: - name: openstack-ansible-calico-ubuntu-xenial-nv + name: openstack-ansible-calico-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: calico - job: - name: openstack-ansible-dragonflow-ubuntu-xenial-nv + name: openstack-ansible-dragonflow-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: dragonflow - job: - name: openstack-ansible-opendaylight-ubuntu-xenial-nv + name: openstack-ansible-opendaylight-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: opendaylight - job: name: openstack-ansible-ovs-nsh-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: ovs-nsh -- job: - name: openstack-ansible-neutron-ssl-nv - parent: openstack-ansible-functional-ubuntu-xenial - voting: false - vars: - tox_env: ssl - - job: name: openstack-ansible-odl-sfc-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: odl-sfc - job: name: openstack-ansible-opendaylight-bgpvpn-ubuntu-xenial parent: openstack-ansible-functional-ubuntu-xenial - voting: false vars: tox_env: opendaylight-bgpvpn diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 81076b8f..e757757f 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -20,17 +20,18 @@ - release-notes-jobs check: jobs: - - openstack-ansible-upgrade-ubuntu-xenial - - openstack-ansible-ovs-ubuntu-xenial-nv - - openstack-ansible-ovn-ubuntu-xenial-nv - - openstack-ansible-ovn-centos-7-nv - - openstack-ansible-calico-ubuntu-xenial-nv - - openstack-ansible-dragonflow-ubuntu-xenial-nv - - openstack-ansible-opendaylight-ubuntu-xenial-nv + - openstack-ansible-ovs-ubuntu-xenial + - openstack-ansible-ovn-ubuntu-xenial + - openstack-ansible-ovn-centos-7 + - openstack-ansible-calico-ubuntu-xenial: + voting: false + - openstack-ansible-dragonflow-ubuntu-xenial: + voting: false + - openstack-ansible-opendaylight-ubuntu-xenial - openstack-ansible-ovs-nsh-ubuntu-xenial - - openstack-ansible-neutron-ssl-nv - openstack-ansible-odl-sfc-ubuntu-xenial - - openstack-ansible-opendaylight-bgpvpn-ubuntu-xenial + - openstack-ansible-opendaylight-bgpvpn-ubuntu-xenial: + voting: false - openstack-ansible-functional-distro_install-ubuntu-xenial # NOTE(hwoarang) Centos7 is having some troubles with repo dependencies # so disabling until it's investigated. @@ -39,6 +40,11 @@ - openstack-ansible-functional-distro_install-opensuse-423 gate: jobs: - - openstack-ansible-upgrade-ubuntu-xenial + - openstack-ansible-ovs-ubuntu-xenial + - openstack-ansible-ovn-ubuntu-xenial + - openstack-ansible-ovn-centos-7 + - openstack-ansible-opendaylight-ubuntu-xenial + - openstack-ansible-ovs-nsh-ubuntu-xenial + - openstack-ansible-odl-sfc-ubuntu-xenial - openstack-ansible-functional-distro_install-ubuntu-xenial - openstack-ansible-functional-distro_install-opensuse-423