Browse Source

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
Alex Schultz 7 months ago
parent
commit
5a6ba28893

+ 1
- 0
roles/validate-tempest/README.md View File

@@ -61,6 +61,7 @@ Role Variables
61 61
   `public_physical_network`, `public_segmentation_id` -- parameters used to create the public floating IP network
62 62
 * `tempest_deployer_input_file`: <file path> The path to tripleo deployer input file which contains the pre configured
63 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
 
66 67
 Skip tests file

+ 1
- 0
roles/validate-tempest/defaults/main.yml View File

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

+ 15
- 2
roles/validate-tempest/templates/configure-tempest.sh.j2 View File

@@ -15,8 +15,13 @@ sudo rm -rf {{ tempest_dir }}
15 15
 # Remove tempest_data directory created before running tempest container
16 16
 sudo 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 != '' %}
21
+export OS_CLOUD={{ tempest_os_cloud }}
22
+{% else %}
19 23
 source {{ rc_file }}
24
+{% endif %}
20 25
 
21 26
 ## Create Tempest resources
22 27
 ## ------------------------
@@ -90,8 +95,9 @@ popd
90 95
 ## ::
91 96
 export TEMPESTCONF="{{ tempestconf }}"
92 97
 
93
-# Source rc file for tempestconf generation
98
+{% if not tempest_os_cloud != '' %}
94 99
 source {{ rc_file }}
100
+{% endif %}
95 101
 
96 102
 {% if tempest_overcloud|bool %}
97 103
 # Get public net id
@@ -104,7 +110,11 @@ public_net_id=$(openstack network show {{ public_net_name }} -f value -c id)
104 110
 {% endif %}
105 111
 
106 112
 {% if not tempest_overcloud|bool %}
113
+# query the endpoint if not set (e.g. clouds.yaml)
114
+export OS_AUTH_URL=${OS_AUTH_URL:-$(openstack endpoint list --service=identity --interface=public -c URL -f value)}
107 115
 {% if release not in ['newton', 'ocata'] %}
116
+# set the itentity api version if not set (e.g. clouds.yaml)
117
+export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3}
108 118
 # OS_AUTH_URL does not contains identity api version in stackrc from
109 119
 # Pike onwards.
110 120
 export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION"
@@ -121,6 +131,9 @@ $TEMPESTCONF --out etc/tempest.conf \
121 131
   --deployer-input {{ working_dir }}/{{ tempest_deployer_input_file }} \
122 132
   --network-id $public_net_id \
123 133
   {% endif %}
134
+  {% if tempest_os_cloud %}
135
+  --os-cloud {{ tempest_os_cloud }} \
136
+  {% endif %}
124 137
   --image {{ tempest_test_image_path }} \
125 138
   --debug \
126 139
   {% if tempest_conf_removal and tempest_overcloud|bool %}

Loading…
Cancel
Save