Nova upgrade testing.

Implement upgrade testing for os_nova role.

This patch adds an upgrade testenv, which configures a previous version
of Nova, and the test-vars from the previous stable branch to be used
by the previous version of Nova.

We don't run functional tests after the initial stable/newton deploy
because a working stable/newton branch is already tested, and it's
assumed it worked if the upgrade works too - which is more
efficient.

This follows the pattern setup for Keystone in:
https://review.openstack.org/#/c/384269/

TODO: (andymccr)
Nova deprecated the nova_cert project, which means the group has been
removed from the os_nova role. For now a workaround has been added to
add the nova_cert group to the upgrades inventory, the default is to
have nova_cert in it's own container so we could just remove those as
part of an N->O Upgrade.

Change-Id: I3a83c3f91c85ea532d1963c007bb81cae6de2cd7
Implements: blueprint upgrade-testing
This commit is contained in:
Andy McCrae 2016-11-21 10:47:36 +00:00
parent 7e9b6baf32
commit 1c9ebcec8f
5 changed files with 195 additions and 0 deletions

View File

@ -58,3 +58,7 @@
src: https://git.openstack.org/openstack/openstack-ansible-os_tempest
scm: git
version: master
- name: os_previous_nova
src: https://git.openstack.org/openstack/openstack-ansible-os_nova
scm: git
version: stable/newton

View File

@ -0,0 +1,62 @@
---
# 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.
- include: common/setting-nodepool-variables.yml
- name: Playbook for deploying nova
hosts: nova_all
user: root
gather_facts: true
pre_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 (Ubuntu)
apt:
name: "{{ item }}"
with_items:
- libxml2-dev
- libxslt-dev
- libffi-dev
- pkg-config
- libvirt-dev
when:
- inventory_hostname in groups['nova_all']
- ansible_pkg_mgr == 'apt'
- name: Install packages required to build nova python package (CentOS)
yum:
name: "{{ item }}"
with_items:
- libxml2-devel
- libxslt-devel
- libffi-devel
- pkgconfig
- libvirt-devel
when:
- inventory_hostname in groups['nova_all']
- ansible_pkg_mgr == 'yum'
- include: common/ensure-rabbitmq.yml
vhost_name: "{{ nova_rabbitmq_vhost }}"
user_name: "{{ nova_rabbitmq_userid }}"
user_password: "{{ nova_rabbitmq_password }}"
- include: common/create-grant-db.yml
db_name: "{{ nova_galera_database }}"
db_password: "{{ nova_container_mysql_password }}"
- include: common/create-grant-db.yml
db_name: "{{ nova_api_galera_database }}"
db_password: "{{ nova_container_mysql_password }}"
roles:
- role: "os_previous_nova"
vars_files:
- common/previous/test-vars.yml

View File

@ -28,6 +28,12 @@
# Install Neutron
- include: common/test-install-neutron.yml
# Install previous Nova
- include: test-install-previous-nova.yml
when:
- nova_upgrade is defined
- nova_upgrade | bool
# Install Nova
- include: common/test-install-nova.yml

107
tests/upgrades-inventory Normal file
View File

@ -0,0 +1,107 @@
[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_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
[utility_all]
infra1

16
tox.ini
View File

@ -109,6 +109,22 @@ commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:upgrade]
deps =
{[testenv:ansible]deps}
setenv =
{[testenv]setenv}
ANSIBLE_INVENTORY={toxinidir}/tests/upgrades-inventory
ANSIBLE_PARAMETERS=-vvv -e nova_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/common/test-ansible-functional.sh"
[testenv:func_lxd]
deps =
{[testenv:ansible]deps}