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 rename the tox target for 'func_lxc' to 'lxc' and
   as the 'func_' prefix is pointless.
4. We remove the base python setting in the lxc tox target
   because we're not running our functional tests using py3
   yet.

Change-Id: Ie0e72f69026c44a3c3ff6316bbb308bdd873c149
This commit is contained in:
Jesse Pretorius 2018-09-07 19:13:22 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 882bb255f1
commit f6ab8c4a8a
9 changed files with 3 additions and 378 deletions

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.
- include: test-nova-resources-upgrade.yml
- include: common/test-install-nova.yml
- include: test-nova-resources-results.yml

View File

@ -1,103 +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.
- include: common/previous/setting-nodepool-variables.yml
# Ensure the repo is setup for previous version
- include: common/previous/test-repo-setup.yml
- name: Prepare for nova services
hosts: nova_all
user: root
become: true
gather_facts: true
any_errors_fatal: true
vars:
required_packages:
apt:
- libxml2-dev
- libxslt-dev
- libffi-dev
- pkg-config
- libvirt-dev
dnf:
- libxml2-devel
- libxslt-devel
- libffi-devel
- pkgconfig
- libvirt-devel
yum:
- libxml2-devel
- libxslt-devel
- libffi-devel
- pkgconfig
- libvirt-devel
zypper:
- libxml2-devel
- libxslt-devel
- libffi-devel
- pkg-config
- libvirt-devel
vars_files:
- common/previous/test-vars.yml
tasks:
# NOTE: These are typically installed in the repo server where we build the
# nova wheel
- name: Install packages required to build nova python package
package:
name: "{{ required_packages[ansible_pkg_mgr] }}"
state: present
- include: common/previous/ensure-rabbitmq.yml
vhost_name: "{{ nova_rabbitmq_vhost }}"
user_name: "{{ nova_rabbitmq_userid }}"
user_password: "{{ nova_rabbitmq_password }}"
- include: common/previous/create-grant-db.yml
db_name: "{{ nova_galera_database }}"
db_password: "{{ nova_container_mysql_password }}"
- include: common/previous/create-grant-db.yml
db_name: "{{ nova_api_galera_database }}"
db_password: "{{ nova_api_container_mysql_password }}"
- include: common/previous/create-grant-db.yml
db_name: "{{ nova_cell0_database }}"
db_password: "{{ nova_api_container_mysql_password }}"
db_user: "{{ nova_api_galera_user }}"
db_append_privs: "yes"
- name: Deploy nova control plane
hosts: "nova_all:!nova_compute"
user: root
become: true
gather_facts: true
any_errors_fatal: true
roles:
- role: "os_previous_nova"
vars_files:
- common/previous/test-vars.yml
- name: Deploy nova compute
hosts: "nova_compute"
user: root
become: true
gather_facts: true
any_errors_fatal: true
roles:
- role: "os_previous_nova"
vars_files:
- common/previous/test-vars.yml

View File

@ -1,28 +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
tasks:
- name: Kill resource test
command: pkill -f rolling_test
- 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,57 +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
# TODO: remove the static reference to openstack1
vars:
test_keystone_host: openstack1
working_dir: "{{ lookup('env', 'WORKING_DIR') }}"
upgrade_venv_folder: "/openstack/venvs/upgrades"
upgrade_test_packages:
- "python-keystoneclient"
- "python-glanceclient"
- "openstacksdk"
tasks:
- 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 nova
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,110 +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.
# Due to the way Ansible caches and handles modules, we need to run
# separate Ansible runs to ensure the "upgrade" uses the new
# "neutron_migrations_facts" module, instead of the cached version
# used when deploying the previous Neutron version.
## Shell Opts ----------------------------------------------------------------
set -e
## Vars ----------------------------------------------------------------------
export WORKING_DIR=${WORKING_DIR:-$(pwd)}
export ROLE_NAME=${ROLE_NAME:-''}
export ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-""}
export ANSIBLE_OVERRIDES=${ANSIBLE_OVERRIDES:-$WORKING_DIR/tests/os_nova-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) Nova
# No upgrading or testing is done yet.
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-nova-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-nova.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_nova-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 Nova
execute_ansible_playbook
# Unset previous branch overrides
unset PREVIOUS_VENV
unset ANSIBLE_BIN
# Prepare environment for the upgrade of Nova
export TEST_PLAYBOOK="${WORKING_DIR}/tests/benchmark-upgrade.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-nova-upgrade.log"
# Excute the upgrade of Nova
execute_ansible_playbook
# Prepare the environment for the testing of upgraded Nova
export TEST_PLAYBOOK="${COMMON_TESTS_PATH}/test-install-tempest.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-nova-upgrade-test.log"
# Execute testing of upgraded Nova
execute_ansible_playbook

View File

@ -1,29 +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 host
- include: common/test-setup-host.yml
# Install RabbitMQ/MariaDB
- include: common/test-install-infra.yml
# Install Keystone
- include: common/test-install-keystone.yml
# Install Glance
- include: common/test-install-glance.yml
# Install Neutron
- include: common/test-install-neutron.yml

22
tox.ini
View File

@ -93,6 +93,7 @@ commands =
commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:distro_install]
setenv =
{[testenv]setenv}
@ -100,18 +101,8 @@ setenv =
commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:upgrade]
basepython = python3
setenv =
{[testenv]setenv}
TEST_PLAYBOOK={toxinidir}/tests/test-upgrade.yml
CLONE_UPGRADE_TESTS=yes
commands =
bash -c "{toxinidir}/tests/test-nova-upgrades.sh"
[testenv:func_lxd]
basepython = python3
[testenv:lxd]
setenv =
{[testenv]setenv}
ANSIBLE_OVERRIDES={toxinidir}/tests/os_nova-overrides-lxd.yml
@ -119,15 +110,6 @@ commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:ssl]
basepython = python3
setenv =
{[testenv]setenv}
ANSIBLE_PARAMETERS=-vvv -e galera_use_ssl=True
commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:linters]
basepython = python3
commands =

View File

@ -17,11 +17,4 @@
name: openstack-ansible-lxd-ubuntu-xenial
parent: openstack-ansible-functional-ubuntu-xenial
vars:
tox_env: func_lxd
- job:
name: openstack-ansible-nova-ssl-nv
parent: openstack-ansible-functional-ubuntu-xenial
voting: false
vars:
tox_env: ssl
tox_env: lxd

View File

@ -20,9 +20,7 @@
- release-notes-jobs-python3
check:
jobs:
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-lxd-ubuntu-xenial
- openstack-ansible-nova-ssl-nv
- openstack-ansible-functional-distro_install-centos-7
- openstack-ansible-functional-distro_install-opensuse-423
# NOTE(hwoarang) xenial does not currently work. It needs investigation
@ -30,7 +28,6 @@
voting: false
gate:
jobs:
- openstack-ansible-upgrade-ubuntu-xenial
- openstack-ansible-lxd-ubuntu-xenial
- openstack-ansible-functional-distro_install-centos-7
- openstack-ansible-functional-distro_install-opensuse-423