Browse code

add options to support nova test matrix

This adds 2 devstack options:

NOVA_V2_LEGACY={True/False} which is whether we'd like to force the
/v2 endpoint to use the legacy v2.0 code base.

it also provides TEMPEST_COMPUTE_TYPE as an way to pass in which
service catalog entry we'd like to use for compute testing.

We also make v2.1 the default compute endpoint, as that's what we'd
like everyone to be testing and using. The other options will let us
build jobs that nova can run to ensure those APIs don't regress.

Change-Id: Ie6b7e4290d9a1d9789d04099b3b31c9a557bc22b

Sean Dague authored on 2015/09/02 01:45:28
Showing 2 changed files
... ...
@@ -64,6 +64,11 @@ NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini}
64 64
 # Expect to remove in L or M.
65 65
 NOVA_API_VERSION=${NOVA_API_VERSION-default}
66 66
 
67
+# NOVA_V2_LEGACY defines whether we force the Nova v2.0 enpoint onto
68
+# the Nova v2.0 legacy code base. Remove this option once the Nova
69
+# v2.0 legacy codebase is removed.
70
+NOVA_V2_LEGACY=$(trueorfalse False NOVA_V2_LEGACY)
71
+
67 72
 if is_suse; then
68 73
     NOVA_WSGI_DIR=${NOVA_WSGI_DIR:-/srv/www/htdocs/nova}
69 74
 else
... ...
@@ -317,6 +322,13 @@ function configure_nova {
317 317
         if [[ "$NOVA_API_VERSION" == "v21default" ]]; then
318 318
             sed -i s/": openstack_compute_api_v2$"/": openstack_compute_api_v21"/ "$NOVA_API_PASTE_INI"
319 319
         fi
320
+
321
+        # For setting up an environment where v2.0 is running on the
322
+        # v2.0 legacy code base.
323
+        if [[ "$NOVA_V2_LEGACY" == "True" ]]; then
324
+            sed -i s@"^/v2: openstack_compute_api_v21_legacy_v2_compatible$"@"/v2: openstack_compute_api_legacy_v2"@ \
325
+                "$NOVA_API_PASTE_INI"
326
+        fi
320 327
     fi
321 328
 
322 329
     if is_service_enabled n-cpu; then
... ...
@@ -411,15 +423,16 @@ function create_nova_accounts {
411 411
                 nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST/compute"
412 412
             fi
413 413
 
414
-            get_or_create_service "nova" "compute" "Nova Compute Service"
415
-            get_or_create_endpoint "compute" \
414
+            get_or_create_service "nova_legacy" "compute_legacy" \
415
+                "Nova Compute Service (Legacy 2.0)"
416
+            get_or_create_endpoint "compute_legacy" \
416 417
                 "$REGION_NAME" \
417 418
                 "$nova_api_url/v2/\$(tenant_id)s" \
418 419
                 "$nova_api_url/v2/\$(tenant_id)s" \
419 420
                 "$nova_api_url/v2/\$(tenant_id)s"
420 421
 
421
-            get_or_create_service "novav21" "computev21" "Nova Compute Service V2.1"
422
-            get_or_create_endpoint "computev21" \
422
+            get_or_create_service "nova" "compute" "Nova Compute Service"
423
+            get_or_create_endpoint "compute" \
423 424
                 "$REGION_NAME" \
424 425
                 "$nova_api_url/v2.1/\$(tenant_id)s" \
425 426
                 "$nova_api_url/v2.1/\$(tenant_id)s" \
... ...
@@ -361,6 +361,14 @@ function configure_tempest {
361 361
         iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME
362 362
     fi
363 363
 
364
+    # Set the service catalog entry for Tempest to run on. Typically
365
+    # used to try different compute API version targets. The tempest
366
+    # default if 'compute', which is typically valid, so only set this
367
+    # if you want to change it.
368
+    if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then
369
+        iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE
370
+    fi
371
+
364 372
     # Compute Features
365 373
     # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
366 374
     # NOTE(mtreinish): This must be done after auth settings are added to the tempest config