diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index 691129be..6af5c3ec 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -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 diff --git a/tests/test-install-previous-nova.yml b/tests/test-install-previous-nova.yml new file mode 100644 index 00000000..0feffc93 --- /dev/null +++ b/tests/test-install-previous-nova.yml @@ -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 diff --git a/tests/test.yml b/tests/test.yml index 7d196716..f0ebc4de 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -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 diff --git a/tests/upgrades-inventory b/tests/upgrades-inventory new file mode 100644 index 00000000..60a21cf0 --- /dev/null +++ b/tests/upgrades-inventory @@ -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 diff --git a/tox.ini b/tox.ini index 18638e00..7b94a4c7 100644 --- a/tox.ini +++ b/tox.ini @@ -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}