From 38e3c46907977860ea9bd28f1a608f4fa633591c Mon Sep 17 00:00:00 2001 From: Matt Thompson Date: Mon, 25 Apr 2016 10:57:36 +0100 Subject: [PATCH] Use tempest for functional testing Depends-On: I30a877f6c84f66ca05381969d015850078532e1f Change-Id: I34ff88713a1c5eb09c009f0a304f61b44c00abde --- tests/ansible-role-requirements.yml | 4 ++++ tests/test-cinder-functional.yml | 19 +++++-------------- tests/test-install-tempest.yml | 23 +++++++++++++++++++++++ tests/test-vars.yml | 15 +++++++++++++++ tests/test.yml | 3 +++ 5 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 tests/test-install-tempest.yml diff --git a/tests/ansible-role-requirements.yml b/tests/ansible-role-requirements.yml index 3f188ee7..10faa592 100644 --- a/tests/ansible-role-requirements.yml +++ b/tests/ansible-role-requirements.yml @@ -46,6 +46,10 @@ src: https://git.openstack.org/openstack/openstack-ansible-os_keystone scm: git version: master +- name: os_tempest + src: https://git.openstack.org/openstack/openstack-ansible-os_tempest + scm: git + version: master - name: openstack_openrc src: https://git.openstack.org/openstack/openstack-ansible-openstack_openrc scm: git diff --git a/tests/test-cinder-functional.yml b/tests/test-cinder-functional.yml index dc787fbc..41afeacd 100644 --- a/tests/test-cinder-functional.yml +++ b/tests/test-cinder-functional.yml @@ -22,20 +22,11 @@ uri: url: "http://localhost:8776" status_code: 200,300 - - name: Set cinder_volume_name fact - set_fact: - cinder_volume_name: "functional-volume-{{ 100|random }}" - - name: Create cinder volume + - name: Run tempest shell: | - . /root/openrc - {{ cinder_venv_bin }}/cinder create --name {{ cinder_volume_name }} 1 - - name: Verify volume goes active - shell: | - . /root/openrc - {{ cinder_venv_bin }}/cinder show {{ cinder_volume_name }} | grep available - register: volume_status - until: volume_status|success - retries: 5 - delay: 5 + . /opt/tempest_{{ tempest_git_install_branch }}/bin/activate + /opt/tempest_{{ tempest_git_install_branch }}/run_tempest.sh --no-virtual-env ${RUN_TEMPEST_OPTS} tempest.api.volume.test_volumes_get + environment: + RUN_TEMPEST_OPTS: "--serial" vars_files: - test-vars.yml diff --git a/tests/test-install-tempest.yml b/tests/test-install-tempest.yml new file mode 100644 index 00000000..201755ee --- /dev/null +++ b/tests/test-install-tempest.yml @@ -0,0 +1,23 @@ +--- +# 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. + +- name: Playbook for deploying tempest + hosts: openstack1 + user: root + gather_facts: true + roles: + - role: "os_tempest" + vars_files: + - test-vars.yml diff --git a/tests/test-vars.yml b/tests/test-vars.yml index e7e18fd6..a5df46fe 100644 --- a/tests/test-vars.yml +++ b/tests/test-vars.yml @@ -52,4 +52,19 @@ openrc_os_password: "{{ keystone_auth_admin_password }}" rabbitmq_port: 5671 rabbitmq_servers: 10.100.100.2 rabbitmq_use_ssl: true +tempest_developer_mode: True +tempest_git_repo: https://git.openstack.org/openstack/tempest +tempest_git_install_branch: 534a8dc60dfef116156b8f9ee60071a9bf4e4f90 +tempest_git_dest: "/opt/tempest_{{ tempest_git_install_branch | replace('/', '_') }}" +tempest_log_dir: "/var/log/" +tempest_main_group: cinder_all +tempest_service_available_aodh: False +tempest_service_available_ceilometer: False +tempest_service_available_cinder: True +tempest_service_available_glance: False +tempest_service_available_heat: False +tempest_service_available_horizon: False +tempest_service_available_neutron: False +tempest_service_available_nova: False +tempest_service_available_swift: False verbose: true diff --git a/tests/test.yml b/tests/test.yml index 1d9a3dab..b4363e40 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -34,5 +34,8 @@ # Install Cinder - include: test-install-cinder.yml +# Install Tempest +- include: test-install-tempest.yml + # Test Cinder - include: test-cinder-functional.yml