From 72f21662a2a942ed7502afb078a78cb5bf3d8ce3 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Fri, 20 Jan 2017 14:58:49 +0000 Subject: [PATCH] Split out neutron upgrade test The upgrade test causes issues with the regular tests because the module is evaluated and used from the previous_neutron version. This causes the module to fail when not running upgrades. Change-Id: Ifaeb26de5dc9392df4a65f58033b95659998f40d --- tests/test-neutron-upgrades.sh | 2 +- tests/test-upgrade.yml | 31 +++++++++++++++++++++++++++++++ tests/test.yml | 10 ---------- tox.ini | 9 ++++----- 4 files changed, 36 insertions(+), 16 deletions(-) create mode 100644 tests/test-upgrade.yml diff --git a/tests/test-neutron-upgrades.sh b/tests/test-neutron-upgrades.sh index 23a80df2..cc904ff0 100755 --- a/tests/test-neutron-upgrades.sh +++ b/tests/test-neutron-upgrades.sh @@ -37,7 +37,7 @@ 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.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} diff --git a/tests/test-upgrade.yml b/tests/test-upgrade.yml new file mode 100644 index 00000000..2aa64e07 --- /dev/null +++ b/tests/test-upgrade.yml @@ -0,0 +1,31 @@ +--- +# 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 +- include: common/test-setup-host.yml + +# Install RabbitMQ/MariaDB +- include: common/test-install-infra.yml + +# Install etcd +- include: common/test-install-etcd.yml + when: + - groups['neutron_calico_dhcp_agent'] | length > 0 + +# Install Keystone +- include: common/test-install-keystone.yml + +# Install previous Neutron +- include: test-install-previous-neutron.yml diff --git a/tests/test.yml b/tests/test.yml index 67a5403d..57a117b6 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -27,21 +27,11 @@ # Install Keystone - include: common/test-install-keystone.yml -# Install previous Neutron -- include: test-install-previous-neutron.yml - when: - - neutron_upgrade is defined - - neutron_upgrade | bool - # Install Neutron - include: common/test-install-neutron.yml - when: - - (neutron_upgrade is not defined) or (not neutron_upgrade | bool) # Install and execute tempest - include: common/test-install-tempest.yml - when: - - (neutron_upgrade is not defined) or (not neutron_upgrade | bool) - include: test-calico-functional.yml when: diff --git a/tox.ini b/tox.ini index 03637a98..4757c900 100644 --- a/tox.ini +++ b/tox.ini @@ -59,10 +59,6 @@ commands = bash -c "if [ ! -d "{toxinidir}/tests/common" ]; then \ git clone https://git.openstack.org/openstack/openstack-ansible-tests {toxinidir}/tests/common; \ fi" - bash -c "if [ ! -d "{toxinidir}/tests/common/previous" ]; then \ - git clone https://git.openstack.org/openstack/openstack-ansible-tests -b stable/newton \ - {toxinidir}/tests/common/previous; \ - fi" [testenv:pep8] @@ -119,9 +115,12 @@ deps = {[testenv:ansible]deps} setenv = {[testenv]setenv} - ANSIBLE_PARAMETERS=-vvv -e neutron_upgrade=True commands = {[testenv:tests_clone]commands} + bash -c "if [ ! -d "{toxinidir}/tests/common/previous" ]; then \ + git clone https://git.openstack.org/openstack/openstack-ansible-tests -b stable/newton \ + {toxinidir}/tests/common/previous; \ + fi" bash -c "{toxinidir}/tests/test-neutron-upgrades.sh" [testenv:func_ovs]