Browse code

Honor the flag for Identity v3 API only jobs

When the property ENABLE_IDENTITY_V2 is set to
False in the local.conf file, devstack will:

* Disable the v2 API in Keystone paste config;
* Set Tempest to skip Identity v2 tests and use
v3 auth tokens to run all the other tests;
* Set Horizon to use v3 API and v3 auth tokens;
* Register the Identity endpoint as v3.

Change-Id: I2575a516244b848e5ed461e7f488c59edc41068d

Samuel de Medeiros Queiroz authored on 2015/05/04 02:54:45
Showing 4 changed files
... ...
@@ -97,7 +97,14 @@ function init_horizon {
97 97
     _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_DEFAULT_ROLE \"Member\"
98 98
 
99 99
     _horizon_config_set $local_settings "" OPENSTACK_HOST \"${KEYSTONE_SERVICE_HOST}\"
100
-    _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v2.0\""
100
+
101
+    if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
102
+        # Only Identity v3 API is available; then use it with v3 auth tokens
103
+        _horizon_config_set $local_settings "" OPENSTACK_API_VERSIONS {\"identity\":\"v3\"}
104
+        _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v3\""
105
+    else
106
+        _horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_URL "\"${KEYSTONE_SERVICE_PROTOCOL}://${KEYSTONE_SERVICE_HOST}:${KEYSTONE_SERVICE_PORT}/v2.0\""
107
+    fi
101 108
 
102 109
     if [ -f $SSL_BUNDLE_FILE ]; then
103 110
         _horizon_config_set $local_settings "" OPENSTACK_SSL_CACERT \"${SSL_BUNDLE_FILE}\"
... ...
@@ -204,6 +204,12 @@ function configure_keystone {
204 204
         KEYSTONE_PASTE_INI="$KEYSTONE_CONF"
205 205
     fi
206 206
 
207
+    if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
208
+        # Only Identity v3 API should be available; then disable v2 pipelines
209
+        inidelete $KEYSTONE_PASTE_INI composite:main \\/v2.0
210
+        inidelete $KEYSTONE_PASTE_INI composite:admin \\/v2.0
211
+    fi
212
+
207 213
     configure_keystone_extensions
208 214
 
209 215
     # Rewrite stock ``keystone.conf``
... ...
@@ -311,7 +311,15 @@ function configure_tempest {
311 311
         iniset $TEMPEST_CONFIG identity admin_tenant_id $ADMIN_TENANT_ID
312 312
         iniset $TEMPEST_CONFIG identity admin_domain_name $ADMIN_DOMAIN_NAME
313 313
     fi
314
-    iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
314
+    if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
315
+        # Only Identity v3 is available; then skip Identity API v2 tests
316
+        iniset $TEMPEST_CONFIG identity-feature-enabled v2_api False
317
+        # In addition, use v3 auth tokens for running all Tempest tests
318
+        iniset $TEMPEST_CONFIG identity auth_version v3
319
+    else
320
+        iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v2}
321
+    fi
322
+
315 323
     if is_ssl_enabled_service "key" || is_service_enabled tls-proxy; then
316 324
         iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
317 325
     fi
... ...
@@ -87,9 +87,6 @@ TEMPEST_SERVICES=""
87 87
 # Set the default Nova APIs to enable
88 88
 NOVA_ENABLED_APIS=ec2,osapi_compute,metadata
89 89
 
90
-# Configure Identity API version: 2.0, 3
91
-IDENTITY_API_VERSION=2.0
92
-
93 90
 # Whether to use 'dev mode' for screen windows. Dev mode works by
94 91
 # stuffing text into the screen windows so that a developer can use
95 92
 # ctrl-c, up-arrow, enter to restart the service. Starting services
... ...
@@ -106,6 +103,22 @@ elif [[ -f $RC_DIR/.localrc.auto ]]; then
106 106
     source $RC_DIR/.localrc.auto
107 107
 fi
108 108
 
109
+# Configure Identity API version: 2.0, 3
110
+IDENTITY_API_VERSION=${IDENTITY_API_VERSION:-2.0}
111
+
112
+# Set the option ENABLE_IDENTITY_V2 to True. It defines whether the DevStack
113
+# deployment will be deploying the Identity v2 pipelines. If this option is set
114
+# to ``False``, DevStack will: i) disable Identity v2; ii) configure Tempest to
115
+# skip Identity v2 specific tests; and iii) configure Horizon to use Identity
116
+# v3. When this option is set to ``False``, the option IDENTITY_API_VERSION
117
+# will to be set to ``3`` in order to make DevStack register the Identity
118
+# endpoint as v3. This flag is experimental and will be used as basis to
119
+# identify the projects which still have issues to operate with Identity v3.
120
+ENABLE_IDENTITY_V2=$(trueorfalse True ENABLE_IDENTITY_V2)
121
+if [ "$ENABLE_IDENTITY_V2" == "False" ]; then
122
+    IDENTITY_API_VERSION=3
123
+fi
124
+
109 125
 # Enable use of Python virtual environments.  Individual project use of
110 126
 # venvs are controlled by the PROJECT_VENV array; every project with
111 127
 # an entry in the array will be installed into the named venv.