Split upgrade testing into it's own shell script
This will separate out the runs so that variables and modules are not re-used across runs - ensuring the latest modules and versions are used, and ensuring multiple versions of the tests playbook aren't required on non-upgrade runs. Change-Id: Icaeb360a6302ff207d970c0c6fe8e56add1e1327
This commit is contained in:
parent
f83296e073
commit
58bfc33bd2
@ -61,4 +61,4 @@
|
||||
- name: os_previous_nova
|
||||
src: https://git.openstack.org/openstack/openstack-ansible-os_nova
|
||||
scm: git
|
||||
version: stable/newton
|
||||
version: stable/ocata
|
||||
|
99
tests/test-nova-upgrades.sh
Executable file
99
tests/test-nova-upgrades.sh
Executable file
@ -0,0 +1,99 @@
|
||||
#!/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:-"-vvv"}
|
||||
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}"
|
||||
CMD_TO_EXECUTE="ansible-playbook ${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}
|
||||
|
||||
}
|
||||
|
||||
function gate_job_exit_tasks {
|
||||
source "${COMMON_TESTS_PATH}/test-log-collect.sh"
|
||||
}
|
||||
|
||||
## Main ----------------------------------------------------------------------
|
||||
|
||||
# Ensure that the Ansible environment is properly prepared
|
||||
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
|
||||
|
||||
# Set gate job exit traps, this is run regardless of exit state when the job finishes.
|
||||
trap gate_job_exit_tasks EXIT
|
||||
|
||||
# Prepare environment for the initial deploy of previous Nova
|
||||
# No upgrading or testing is done yet.
|
||||
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-nova-install.log"
|
||||
|
||||
# Execute the setup of previous Nova
|
||||
execute_ansible_playbook
|
||||
|
||||
# Prepare environment for the upgrade of Neutron
|
||||
export TEST_PLAYBOOK="${COMMON_TESTS_PATH}/test-install-nova.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 Neutron
|
||||
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
|
@ -30,9 +30,3 @@
|
||||
|
||||
# Install previous Nova
|
||||
- include: test-install-previous-nova.yml
|
||||
|
||||
# Install Nova
|
||||
- include: common/test-install-nova.yml
|
||||
|
||||
# Install Tempest
|
||||
- include: common/test-install-tempest.yml
|
||||
|
@ -1,111 +0,0 @@
|
||||
[all]
|
||||
localhost
|
||||
infra1
|
||||
openstack1
|
||||
|
||||
[all_containers]
|
||||
infra1
|
||||
openstack1
|
||||
|
||||
[rabbitmq_all]
|
||||
infra1
|
||||
|
||||
[galera_all]
|
||||
infra1
|
||||
|
||||
[memcached_all]
|
||||
infra1
|
||||
|
||||
[service_all:children]
|
||||
rabbitmq_all
|
||||
galera_all
|
||||
memcached_all
|
||||
|
||||
[keystone_all]
|
||||
openstack1
|
||||
|
||||
[glance_api]
|
||||
openstack1
|
||||
|
||||
[glance_registry]
|
||||
openstack1
|
||||
|
||||
[glance_all:children]
|
||||
glance_api
|
||||
glance_registry
|
||||
|
||||
[neutron_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_dhcp_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_linuxbridge_agent]
|
||||
openstack1
|
||||
localhost
|
||||
|
||||
[neutron_openvswitch_agent]
|
||||
|
||||
[neutron_metering_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_l3_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_lbaas_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_metadata_agent]
|
||||
openstack1
|
||||
|
||||
[neutron_server]
|
||||
openstack1
|
||||
|
||||
[neutron_all:children]
|
||||
neutron_agent
|
||||
neutron_dhcp_agent
|
||||
neutron_linuxbridge_agent
|
||||
neutron_openvswitch_agent
|
||||
neutron_metering_agent
|
||||
neutron_l3_agent
|
||||
neutron_lbaas_agent
|
||||
neutron_metadata_agent
|
||||
neutron_server
|
||||
|
||||
[nova_api_metadata]
|
||||
openstack1
|
||||
|
||||
[nova_api_os_compute]
|
||||
openstack1
|
||||
|
||||
# Once we move to Pike, remove nova_cert
|
||||
[nova_cert]
|
||||
openstack1
|
||||
|
||||
[nova_api_placement]
|
||||
openstack1
|
||||
|
||||
[nova_compute]
|
||||
localhost
|
||||
|
||||
[nova_conductor]
|
||||
openstack1
|
||||
|
||||
[nova_console]
|
||||
openstack1
|
||||
|
||||
[nova_scheduler]
|
||||
openstack1
|
||||
|
||||
[nova_all:children]
|
||||
nova_api_metadata
|
||||
nova_api_os_compute
|
||||
nova_cert
|
||||
nova_compute
|
||||
nova_conductor
|
||||
nova_console
|
||||
nova_scheduler
|
||||
nova_api_placement
|
||||
|
||||
[utility_all]
|
||||
infra1
|
3
tox.ini
3
tox.ini
@ -115,14 +115,13 @@ deps =
|
||||
setenv =
|
||||
{[testenv]setenv}
|
||||
TEST_PLAYBOOK={toxinidir}/tests/test-upgrade.yml
|
||||
ANSIBLE_INVENTORY={toxinidir}/tests/upgrades-inventory
|
||||
commands =
|
||||
{[testenv:tests_clone]commands}
|
||||
bash -c "if [ ! -d "{toxinidir}/tests/common/previous" ]; then \
|
||||
git clone -b stable/ocata https://git.openstack.org/openstack/openstack-ansible-tests \
|
||||
{toxinidir}/tests/common/previous; \
|
||||
fi"
|
||||
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
|
||||
bash -c "{toxinidir}/tests/test-nova-upgrades.sh"
|
||||
|
||||
|
||||
[testenv:func_lxd]
|
||||
|
Loading…
Reference in New Issue
Block a user