Execute tempest using updated method

The old method of executing tempest via run_tempest.sh from
the root of the git clone has been deprecated and will soon
be removed.

This patch does the following:

- Implements the updated method of executing tempest using
  the foundation laid down in https://review.openstack.org/382211

TODO in a follow-on patch:
When executed in CI, fetch the results for storage with other test
artifacts.

Change-Id: I8f3c58d670a335323be34ac4318b93c928b878cb
This commit is contained in:
Jesse Pretorius
2016-11-01 15:02:35 +00:00
parent 6af61c59a4
commit 485100fbd3
7 changed files with 37 additions and 88 deletions

View File

@@ -13,29 +13,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
tempest_log_dir: /var/log/utility
# Set this if ssh access from the utility container to all other hosts is # Set this if ssh access from the utility container to all other hosts is
# desired # desired
# utility_ssh_private_key: "{{ lookup('file', '/root/.ssh/id_rsa') }}" # utility_ssh_private_key: "{{ lookup('file', '/root/.ssh/id_rsa') }}"
galera_client_drop_config_file: true galera_client_drop_config_file: true
# If cinder has a backup service enabled, make sure that Tempest tests it
tempest_volume_backup_enabled: "{{ cinder_service_backup_program_enabled | bool }}"
# If there are Telemetry hosts in the environment, make sure that Tempest
# tests them
tempest_service_available_aodh: "{{ groups['aodh_all'] is defined and groups['aodh_all'] | length > 0 }}"
tempest_service_available_ceilometer: "{{ groups['ceilometer_all'] is defined and groups['ceilometer_all'] | length > 0 }}"
tempest_service_available_cinder: "{{ groups['cinder_all'] is defined and groups['cinder_all'] | length > 0 }}"
tempest_service_available_glance: "{{ groups['glance_all'] is defined and groups['glance_all'] | length > 0 }}"
tempest_service_available_heat: "{{ groups['heat_all'] is defined and groups['heat_all'] | length > 0 }}"
tempest_service_available_horizon: "{{ groups['horizon_all'] is defined and groups['horizon_all'] | length > 0 }}"
tempest_service_available_neutron: "{{ groups['neutron_all'] is defined and groups['neutron_all'] | length > 0 }}"
tempest_service_available_nova: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 }}"
tempest_service_available_swift: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}"
# Ensure that the package state matches the global setting # Ensure that the package state matches the global setting
utility_package_state: "{{ package_state }}" utility_package_state: "{{ package_state }}"
utility_pip_package_state: "latest" utility_pip_package_state: "latest"
@@ -50,6 +33,35 @@ utility_pip_packages:
- python-memcached - python-memcached
- pycrypto - pycrypto
#
# Tempest settings
#
# If cinder has a backup service enabled, make sure that Tempest tests it
tempest_volume_backup_enabled: "{{ cinder_service_backup_program_enabled | bool }}"
# Activate tempest testing based on the inventory content
tempest_service_available_aodh: "{{ groups['aodh_all'] is defined and groups['aodh_all'] | length > 0 }}"
tempest_service_available_ceilometer: "{{ groups['ceilometer_all'] is defined and groups['ceilometer_all'] | length > 0 }}"
tempest_service_available_cinder: "{{ groups['cinder_all'] is defined and groups['cinder_all'] | length > 0 }}"
tempest_service_available_glance: "{{ groups['glance_all'] is defined and groups['glance_all'] | length > 0 }}"
tempest_service_available_heat: "{{ groups['heat_all'] is defined and groups['heat_all'] | length > 0 }}"
tempest_service_available_horizon: "{{ groups['horizon_all'] is defined and groups['horizon_all'] | length > 0 }}"
tempest_service_available_neutron: "{{ groups['neutron_all'] is defined and groups['neutron_all'] | length > 0 }}"
tempest_service_available_nova: "{{ groups['nova_all'] is defined and groups['nova_all'] | length > 0 }}"
tempest_service_available_swift: "{{ groups['swift_all'] is defined and groups['swift_all'] | length > 0 }}"
tempest_log_dir: /var/log/utility
tempest_venv_tag: "{{ openstack_release }}"
tempest_venv_bin: "/openstack/venvs/tempest-{{ tempest_venv_tag }}/bin"
# This sets the tempest group to the utility group
tempest_main_group: utility_all
#
# Rally settings
#
rally_galera_user: rally rally_galera_user: rally
rally_galera_database_name: rally rally_galera_database_name: rally
rally_galera_address: "{{ galera_address }}" rally_galera_address: "{{ galera_address }}"

View File

@@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
- name: Installation and setup of Tempest - name: Installation and setup of Tempest
hosts: utility_all hosts: utility_all[0]
gather_facts: "{{ gather_facts | default(True) }}" gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20 max_fail_percentage: 20
user: root user: root
@@ -34,8 +34,6 @@
vars_files: vars_files:
- defaults/repo_packages/openstack_testing.yml - defaults/repo_packages/openstack_testing.yml
vars: vars:
# This sets the tempest group to the utility group
tempest_main_group: utility_all
is_metal: "{{ properties.is_metal|default(false) }}" is_metal: "{{ properties.is_metal|default(false) }}"
tags: tags:
- tempest - tempest

View File

@@ -36,3 +36,6 @@
- include: os-magnum-install.yml - include: os-magnum-install.yml
- include: os-trove-install.yml - include: os-trove-install.yml
- include: os-sahara-install.yml - include: os-sahara-install.yml
- include: os-tempest-install.yml
when: (tempest_install | default(False)) | bool or (tempest_run | default(False)) | bool

View File

@@ -106,10 +106,4 @@ bash "$(dirname "${0}")/run-playbooks.sh"
# Log some data about the instance and the rest of the system # Log some data about the instance and the rest of the system
log_instance_info log_instance_info
# Run the tempest tests
source "$(dirname "${0}")/run-tempest.sh"
# Log some data about the instance and the rest of the system
log_instance_info
exit_success exit_success

View File

@@ -142,7 +142,6 @@ pushd "playbooks"
-a 'find /var/www/repo/os-releases -type l' \ -a 'find /var/www/repo/os-releases -type l' \
-t "${COMMAND_LOGS}/repo_data" -t "${COMMAND_LOGS}/repo_data"
openstack-ansible os-tempest-install.yml
print_report print_report
fi fi
popd popd

View File

@@ -1,61 +0,0 @@
#!/usr/bin/env bash
# Copyright 2014, 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.
## Shell Opts ----------------------------------------------------------------
set -e -u +x
## Vars ----------------------------------------------------------------------
export TEMPEST_SCRIPT_PATH=${TEMPEST_SCRIPT_PATH:-/opt/openstack_tempest_gate.sh}
## TODO(someone) this needs to be changed back to the normal tests once someone
## is able to dig into tempest/the updated/deprecated config(s). This test should
## go back to being the scenario tests.
export TEMPEST_SCRIPT_PARAMETERS=${TEMPEST_SCRIPT_PARAMETERS:-"scenario heat_api cinder_backup"}
export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS:-'--serial'}
export TESTR_OPTS=${TESTR_OPTS:-''}
## Library Check -------------------------------------------------------------
info_block "Checking for required libraries." 2> /dev/null || source "$(dirname "${0}")/scripts-library.sh"
## Main ----------------------------------------------------------------------
info_block "Running OpenStack Smoke Tests"
if [[ -f "/usr/local/bin/openstack-ansible.rc" ]];then
source "/usr/local/bin/openstack-ansible.rc"
fi
pushd playbooks
# Check that there are utility containers
if ! ansible 'utility[0]' --list-hosts;then
echo -e "\nERROR: No utility containers have been deployed in your environment\n"
exit_state 99
fi
# Check that the utility container already has the required tempest script deployed
if ! ansible 'utility[0]' -m shell -a "ls -al ${TEMPEST_SCRIPT_PATH}";then
echo -e "\nERROR: Please execute the 'os-tempest-install.yml' playbook prior to this script.\n"
exit_state 99
fi
# Execute the tempest tests
ansible 'utility[0]' -m shell -a "export RUN_TEMPEST_OPTS=${RUN_TEMPEST_OPTS}; \
export TESTR_OPTS=${TESTR_OPTS}; \
${TEMPEST_SCRIPT_PATH} ${TEMPEST_SCRIPT_PARAMETERS}"
# Retrieve tempest test results
ansible 'utility[0]' -m fetch -a 'src=/tmp/tempest_results.xml dest=/tmp/ flat=true'
popd

View File

@@ -90,3 +90,7 @@ neutron_plugin_base:
- router - router
- metering - metering
- neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2 - neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2
## Always setup tempest, the resources for it, then execute tests
tempest_install: yes
tempest_run: yes