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
This commit is contained in:
Jesse Pretorius 2018-09-07 18:35:42 +01:00
parent 3e7c050c05
commit 2c847b53cb
10 changed files with 33 additions and 397 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

24
tox.ini
View File

@ -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"

View File

@ -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

View File

@ -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