From ec0670b27a0700a3bcf5dda1a9d968e426c4ee9f Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Tue, 2 Aug 2016 14:47:41 -0400 Subject: [PATCH] Implement tests for nova-lxd hypervisor This commit implements automated testing for the nova-lxd hypervisor. Change-Id: Ib49312dcb8fb5bd553369819cfd551137ff1c19e --- run_tests.sh | 2 +- tests/test-vars-lxd.yml | 28 ++++++++++++++++++++++++++++ tests/test-vars.yml | 2 +- tox.ini | 27 ++++++++++++++++++++++++++- 4 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 tests/test-vars-lxd.yml diff --git a/run_tests.sh b/run_tests.sh index d9d15b8a..c7f0aa63 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -33,7 +33,7 @@ pip install tox # run through each tox env and execute the test for tox_env in $(awk -F= '/envlist/ {print $2}' tox.ini | sed 's/,/ /g'); do - if [ "${tox_env}" != "functional" ]; then + if [[ "${tox_env}" != "functional" ]] && [[ $tox_env != func_* ]]; then tox -e ${tox_env} elif [ "${tox_env}" == "functional" ]; then if ${FUNCTIONAL_TEST}; then diff --git a/tests/test-vars-lxd.yml b/tests/test-vars-lxd.yml new file mode 100644 index 00000000..ade670fa --- /dev/null +++ b/tests/test-vars-lxd.yml @@ -0,0 +1,28 @@ +--- +# Copyright 2016, Walmart Stores, 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. + +nova_virt_type: lxc + +tempest_img_url: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz" +tempest_img_disk_format: raw +tempest_image_file: "cirros-0.3.4-x86_64-lxc.tar.gz" +tempest_img_name: "cirros" +tempest_images: + - url: "http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-lxc.tar.gz" + sha256: "e8172c603fad47f4c95e67bd2751c2977e07164c9ebdfcf3f9c1d7ff598ed217" + +tempest_tempest_conf_overrides: + 'compute-feature-enabled': + 'config_drive': 'false' diff --git a/tests/test-vars.yml b/tests/test-vars.yml index 53233784..762aca87 100644 --- a/tests/test-vars.yml +++ b/tests/test-vars.yml @@ -62,6 +62,7 @@ keystone_service_internalurl: "{{ keystone_service_internaluri }}/v3" keystone_service_password: "secrete" keystone_service_region: RegionOne keystone_venv_tag: "testing" +lxd_trust_password: "SuperSecrete" memcached_encryption_key: "secrete" memcached_servers: 127.0.0.1 neutron_container_mysql_password: SuperSecrete @@ -116,7 +117,6 @@ nova_service_user_domain_id: default nova_service_user_name: nova nova_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin" nova_venv_tag: "testing" -nova_virt_type: qemu openrc_os_auth_url: "http://127.0.0.1:5000/v3" openrc_os_domain_name: "Default" openrc_os_password: "{{ keystone_auth_admin_password }}" diff --git a/tox.ini b/tox.ini index 9840f1bb..1a7d5bcf 100644 --- a/tox.ini +++ b/tox.ini @@ -146,12 +146,20 @@ commands = ansible-lint {toxinidir} -[testenv:functional] +[testenv:func_base] # NOTE(odyssey4me): this target does not use constraints because # it doesn't work in OpenStack-CI yet. Once that's fixed, we can # drop the install_command. install_command = pip install -U --force-reinstall {opts} {packages} + + +[testenv:functional] +# NOTE(odyssey4me): this target does not use constraints because +# it doesn't work in OpenStack-CI yet. Once that's fixed, we can +# drop the install_command. +install_command = + {[testenv:func_base]install_command} deps = {[testenv:ansible]deps} setenv = @@ -164,6 +172,23 @@ commands = {toxinidir}/tests/test.yml -vvvv +[testenv:func_lxd] +# NOTE(michaelgugino): this target tests nova with lxd +install_command = + {[testenv:func_base]install_command} +deps = + {[testenv:ansible]deps} +setenv = + {[testenv:ansible]setenv} +commands = + {[testenv:ansible]commands} + ansible-playbook -i {toxinidir}/tests/inventory \ + -e @{toxinidir}/tests/test-vars-lxd.yml \ + -e "rolename={toxinidir}" \ + -e "install_test_packages=True" \ + {toxinidir}/tests/test.yml -vvvv + + [testenv:linters] deps = {[testenv:ansible]deps}