From 8349aff5abd26c63470b96e99ade0e8292a87e7a Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 1 Sep 2015 12:45:28 -0400 Subject: [PATCH] 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 --- lib/nova | 21 +++++++++++++++++---- lib/tempest | 8 ++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/lib/nova b/lib/nova index 6441a891eb..dcb4f13bd6 100644 --- a/lib/nova +++ b/lib/nova @@ -64,6 +64,11 @@ NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini} # Expect to remove in L or M. NOVA_API_VERSION=${NOVA_API_VERSION-default} +# NOVA_V2_LEGACY defines whether we force the Nova v2.0 enpoint onto +# the Nova v2.0 legacy code base. Remove this option once the Nova +# v2.0 legacy codebase is removed. +NOVA_V2_LEGACY=$(trueorfalse False NOVA_V2_LEGACY) + if is_suse; then NOVA_WSGI_DIR=${NOVA_WSGI_DIR:-/srv/www/htdocs/nova} else @@ -317,6 +322,13 @@ function configure_nova { if [[ "$NOVA_API_VERSION" == "v21default" ]]; then sed -i s/": openstack_compute_api_v2$"/": openstack_compute_api_v21"/ "$NOVA_API_PASTE_INI" fi + + # For setting up an environment where v2.0 is running on the + # v2.0 legacy code base. + if [[ "$NOVA_V2_LEGACY" == "True" ]]; then + sed -i s@"^/v2: openstack_compute_api_v21_legacy_v2_compatible$"@"/v2: openstack_compute_api_legacy_v2"@ \ + "$NOVA_API_PASTE_INI" + fi fi if is_service_enabled n-cpu; then @@ -411,15 +423,16 @@ function create_nova_accounts { nova_api_url="$NOVA_SERVICE_PROTOCOL://$NOVA_SERVICE_HOST/compute" fi - get_or_create_service "nova" "compute" "Nova Compute Service" - get_or_create_endpoint "compute" \ + get_or_create_service "nova_legacy" "compute_legacy" \ + "Nova Compute Service (Legacy 2.0)" + get_or_create_endpoint "compute_legacy" \ "$REGION_NAME" \ "$nova_api_url/v2/\$(tenant_id)s" \ "$nova_api_url/v2/\$(tenant_id)s" \ "$nova_api_url/v2/\$(tenant_id)s" - get_or_create_service "novav21" "computev21" "Nova Compute Service V2.1" - get_or_create_endpoint "computev21" \ + get_or_create_service "nova" "compute" "Nova Compute Service" + get_or_create_endpoint "compute" \ "$REGION_NAME" \ "$nova_api_url/v2.1/\$(tenant_id)s" \ "$nova_api_url/v2.1/\$(tenant_id)s" \ diff --git a/lib/tempest b/lib/tempest index be24da6b61..df0e382133 100644 --- a/lib/tempest +++ b/lib/tempest @@ -361,6 +361,14 @@ function configure_tempest { iniset $TEMPEST_CONFIG compute fixed_network_name $PRIVATE_NETWORK_NAME fi + # Set the service catalog entry for Tempest to run on. Typically + # used to try different compute API version targets. The tempest + # default if 'compute', which is typically valid, so only set this + # if you want to change it. + if [[ -n "$TEMPEST_COMPUTE_TYPE" ]]; then + iniset $TEMPEST_CONFIG compute catalog_type $TEMPEST_COMPUTE_TYPE + fi + # Compute Features # Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints # NOTE(mtreinish): This must be done after auth settings are added to the tempest config