Add support for OS_CLOUD

Since the standalone deployment uses clouds.yaml, we need the validate
tempest role to allow for configuration using OS_CLOUD rather than the
traditional {stack,overcloud}rc files.

Change-Id: Ied55638618b718ee15a2ef5bc2f89cef232b5b7e
Related-Blueprint: all-in-one
This commit is contained in:
Alex Schultz 2018-09-06 18:01:42 -06:00 committed by Chandan Kumar
parent 9902158a7a
commit 5a6ba28893
3 changed files with 17 additions and 2 deletions

View File

@ -61,6 +61,7 @@ Role Variables
`public_physical_network`, `public_segmentation_id` -- parameters used to create the public floating IP network
* `tempest_deployer_input_file`: <file path> The path to tripleo deployer input file which contains the pre configured
configuration for the deployed cloud using TripleO.
* `tempest_os_cloud`: <string> String name of the cloud to export as OS_CLOUD when using clouds.yaml rather than stackrc
Skip tests file

View File

@ -69,3 +69,4 @@ tempest_test_image_path: http://download.cirros-cloud.net/{{ tempest_test_image_
# A dict containing values to be removed from tempest.conf
tempest_conf_removal:
network-feature-enabled.api_extensions: dvr
tempest_os_cloud: ""

View File

@ -15,8 +15,13 @@ sudo rm -rf {{ tempest_dir }}
# Remove tempest_data directory created before running tempest container
sudo rm -rf {{ working_dir }}/tempest_data
# Source rc file
# Cloud Credentials
{% if tempest_os_cloud is defined and tempest_os_cloud != '' %}
export OS_CLOUD={{ tempest_os_cloud }}
{% else %}
source {{ rc_file }}
{% endif %}
## Create Tempest resources
## ------------------------
@ -90,8 +95,9 @@ popd
## ::
export TEMPESTCONF="{{ tempestconf }}"
# Source rc file for tempestconf generation
{% if not tempest_os_cloud != '' %}
source {{ rc_file }}
{% endif %}
{% if tempest_overcloud|bool %}
# Get public net id
@ -104,7 +110,11 @@ public_net_id=$(openstack network show {{ public_net_name }} -f value -c id)
{% endif %}
{% if not tempest_overcloud|bool %}
# query the endpoint if not set (e.g. clouds.yaml)
export OS_AUTH_URL=${OS_AUTH_URL:-$(openstack endpoint list --service=identity --interface=public -c URL -f value)}
{% if release not in ['newton', 'ocata'] %}
# set the itentity api version if not set (e.g. clouds.yaml)
export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3}
# OS_AUTH_URL does not contains identity api version in stackrc from
# Pike onwards.
export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION"
@ -121,6 +131,9 @@ $TEMPESTCONF --out etc/tempest.conf \
--deployer-input {{ working_dir }}/{{ tempest_deployer_input_file }} \
--network-id $public_net_id \
{% endif %}
{% if tempest_os_cloud %}
--os-cloud {{ tempest_os_cloud }} \
{% endif %}
--image {{ tempest_test_image_path }} \
--debug \
{% if tempest_conf_removal and tempest_overcloud|bool %}