summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Schultz <aschultz@redhat.com>2018-09-06 18:01:42 -0600
committerChandan Kumar <chkumar@redhat.com>2018-09-13 20:38:55 +0530
commit5a6ba2889373912e2c9475082d9ab8a8d3499faa (patch)
treecc938a8231969755adc0724837999a617af1cb53
parent9902158a7a82f1954a6d357abccce9dff35f80c7 (diff)
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
Notes
Notes (review): Code-Review+1: Arx Cruz <arxcruz@redhat.com> Verified+1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Code-Review+2: Sagi Shnaidman <sshnaidm@redhat.com> Code-Review+2: Gabriele Cerami <gcerami@redhat.com> Workflow+1: Gabriele Cerami <gcerami@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Sat, 15 Sep 2018 14:35:28 +0000 Reviewed-on: https://review.openstack.org/600586 Project: openstack/tripleo-quickstart-extras Branch: refs/heads/master
-rw-r--r--roles/validate-tempest/README.md1
-rw-r--r--roles/validate-tempest/defaults/main.yml1
-rw-r--r--roles/validate-tempest/templates/configure-tempest.sh.j217
3 files changed, 17 insertions, 2 deletions
diff --git a/roles/validate-tempest/README.md b/roles/validate-tempest/README.md
index 1516472..227e3fd 100644
--- a/roles/validate-tempest/README.md
+++ b/roles/validate-tempest/README.md
@@ -61,6 +61,7 @@ Role Variables
61 `public_physical_network`, `public_segmentation_id` -- parameters used to create the public floating IP network 61 `public_physical_network`, `public_segmentation_id` -- parameters used to create the public floating IP network
62* `tempest_deployer_input_file`: <file path> The path to tripleo deployer input file which contains the pre configured 62* `tempest_deployer_input_file`: <file path> The path to tripleo deployer input file which contains the pre configured
63 configuration for the deployed cloud using TripleO. 63 configuration for the deployed cloud using TripleO.
64* `tempest_os_cloud`: <string> String name of the cloud to export as OS_CLOUD when using clouds.yaml rather than stackrc
64 65
65 66
66Skip tests file 67Skip tests file
diff --git a/roles/validate-tempest/defaults/main.yml b/roles/validate-tempest/defaults/main.yml
index b6417ee..c481744 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_
69# A dict containing values to be removed from tempest.conf 69# A dict containing values to be removed from tempest.conf
70tempest_conf_removal: 70tempest_conf_removal:
71 network-feature-enabled.api_extensions: dvr 71 network-feature-enabled.api_extensions: dvr
72tempest_os_cloud: ""
diff --git a/roles/validate-tempest/templates/configure-tempest.sh.j2 b/roles/validate-tempest/templates/configure-tempest.sh.j2
index b089d59..77083b7 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 }}
15# Remove tempest_data directory created before running tempest container 15# Remove tempest_data directory created before running tempest container
16sudo rm -rf {{ working_dir }}/tempest_data 16sudo rm -rf {{ working_dir }}/tempest_data
17 17
18# Source rc file 18
19# Cloud Credentials
20{% if tempest_os_cloud is defined and tempest_os_cloud != '' %}
21export OS_CLOUD={{ tempest_os_cloud }}
22{% else %}
19source {{ rc_file }} 23source {{ rc_file }}
24{% endif %}
20 25
21## Create Tempest resources 26## Create Tempest resources
22## ------------------------ 27## ------------------------
@@ -90,8 +95,9 @@ popd
90## :: 95## ::
91export TEMPESTCONF="{{ tempestconf }}" 96export TEMPESTCONF="{{ tempestconf }}"
92 97
93# Source rc file for tempestconf generation 98{% if not tempest_os_cloud != '' %}
94source {{ rc_file }} 99source {{ rc_file }}
100{% endif %}
95 101
96{% if tempest_overcloud|bool %} 102{% if tempest_overcloud|bool %}
97# Get public net id 103# Get public net id
@@ -104,7 +110,11 @@ public_net_id=$(openstack network show {{ public_net_name }} -f value -c id)
104{% endif %} 110{% endif %}
105 111
106{% if not tempest_overcloud|bool %} 112{% if not tempest_overcloud|bool %}
113# query the endpoint if not set (e.g. clouds.yaml)
114export OS_AUTH_URL=${OS_AUTH_URL:-$(openstack endpoint list --service=identity --interface=public -c URL -f value)}
107{% if release not in ['newton', 'ocata'] %} 115{% if release not in ['newton', 'ocata'] %}
116# set the itentity api version if not set (e.g. clouds.yaml)
117export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3}
108# OS_AUTH_URL does not contains identity api version in stackrc from 118# OS_AUTH_URL does not contains identity api version in stackrc from
109# Pike onwards. 119# Pike onwards.
110export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION" 120export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION"
@@ -121,6 +131,9 @@ $TEMPESTCONF --out etc/tempest.conf \
121 --deployer-input {{ working_dir }}/{{ tempest_deployer_input_file }} \ 131 --deployer-input {{ working_dir }}/{{ tempest_deployer_input_file }} \
122 --network-id $public_net_id \ 132 --network-id $public_net_id \
123 {% endif %} 133 {% endif %}
134 {% if tempest_os_cloud %}
135 --os-cloud {{ tempest_os_cloud }} \
136 {% endif %}
124 --image {{ tempest_test_image_path }} \ 137 --image {{ tempest_test_image_path }} \
125 --debug \ 138 --debug \
126 {% if tempest_conf_removal and tempest_overcloud|bool %} 139 {% if tempest_conf_removal and tempest_overcloud|bool %}