diff --git a/roles/validate-tempest/README.md b/roles/validate-tempest/README.md index 15164724e..227e3fd0c 100644 --- a/roles/validate-tempest/README.md +++ b/roles/validate-tempest/README.md @@ -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`: The path to tripleo deployer input file which contains the pre configured configuration for the deployed cloud using TripleO. +* `tempest_os_cloud`: String name of the cloud to export as OS_CLOUD when using clouds.yaml rather than stackrc Skip tests file diff --git a/roles/validate-tempest/defaults/main.yml b/roles/validate-tempest/defaults/main.yml index b6417eee5..c481744c9 100644 --- a/roles/validate-tempest/defaults/main.yml +++ b/roles/validate-tempest/defaults/main.yml @@ -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: "" diff --git a/roles/validate-tempest/templates/configure-tempest.sh.j2 b/roles/validate-tempest/templates/configure-tempest.sh.j2 index b089d5962..77083b75e 100644 --- a/roles/validate-tempest/templates/configure-tempest.sh.j2 +++ b/roles/validate-tempest/templates/configure-tempest.sh.j2 @@ -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 %}