Skip to content

Commit 8e3809a

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix usage of tempest utils during config"
2 parents 09a710b + e8f3f7a commit 8e3809a

1 file changed

Lines changed: 70 additions & 67 deletions

File tree

lib/tempest

Lines changed: 70 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -317,44 +317,6 @@ function configure_tempest {
317317
fi
318318

319319
# Compute Features
320-
# Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
321-
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
322-
local tmp_cfg_file
323-
tmp_cfg_file=$(mktemp)
324-
cd $TEMPEST_DIR
325-
if [[ "$OFFLINE" != "True" ]]; then
326-
tox -revenv --notest
327-
fi
328-
329-
# Auth
330-
iniset $TEMPEST_CONFIG auth tempest_roles "Member"
331-
if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
332-
if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
333-
tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
334-
else
335-
tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY etc/accounts.yaml
336-
fi
337-
iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
338-
iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
339-
elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
340-
iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
341-
342-
else
343-
iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
344-
fi
345-
346-
# NOTE(mtreinish): Respect constraints on tempest verify-config venv
347-
tox -evenv -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
348-
tox -evenv -- tempest verify-config -uro $tmp_cfg_file
349-
350-
local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
351-
if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
352-
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
353-
compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
354-
# Remove disabled extensions
355-
compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
356-
fi
357-
358320
# Set the microversion range for compute tests.
359321
# This is used to run the Nova microversions tests.
360322
# Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
@@ -383,7 +345,6 @@ function configure_tempest {
383345
iniset $TEMPEST_CONFIG compute-feature-enabled live_migration ${LIVE_MIGRATION_AVAILABLE:-False}
384346
iniset $TEMPEST_CONFIG compute-feature-enabled change_password False
385347
iniset $TEMPEST_CONFIG compute-feature-enabled block_migration_for_live_migration ${USE_BLOCK_MIGRATION_FOR_LIVE_MIGRATION:-False}
386-
iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
387348
# TODO(mriedem): Remove the preserve_ports flag when Juno is end of life.
388349
iniset $TEMPEST_CONFIG compute-feature-enabled preserve_ports True
389350
# TODO(gilliard): Remove the live_migrate_paused_instances flag when Juno is end of life.
@@ -420,15 +381,6 @@ function configure_tempest {
420381
iniset $TEMPEST_CONFIG network-feature-enabled ipv6 "$IPV6_ENABLED"
421382
iniset $TEMPEST_CONFIG network-feature-enabled ipv6_subnet_attributes "$IPV6_SUBNET_ATTRIBUTES_ENABLED"
422383

423-
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
424-
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
425-
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
426-
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
427-
# Remove disabled extensions
428-
network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
429-
fi
430-
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
431-
432384
# Orchestration Tests
433385
if is_service_enabled heat; then
434386
if [[ ! -z "$HEAT_CFN_IMAGE_URL" ]]; then
@@ -461,16 +413,6 @@ function configure_tempest {
461413
# Telemetry
462414
iniset $TEMPEST_CONFIG telemetry-feature-enabled events "True"
463415

464-
# Object Store
465-
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
466-
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
467-
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
468-
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
469-
# Remove disabled extensions
470-
object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
471-
fi
472-
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
473-
474416
# Validation
475417
iniset $TEMPEST_CONFIG validation run_validation ${TEMPEST_RUN_VALIDATION:-False}
476418
iniset $TEMPEST_CONFIG validation ip_version_for_ssh 4
@@ -484,15 +426,6 @@ function configure_tempest {
484426
# TODO(ynesenenko): Remove the volume_services flag when Liberty and Kilo will correct work with host info.
485427
iniset $TEMPEST_CONFIG volume-feature-enabled volume_services True
486428

487-
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
488-
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
489-
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
490-
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
491-
# Remove disabled extensions
492-
volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
493-
fi
494-
iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
495-
496429
if ! is_service_enabled c-bak; then
497430
iniset $TEMPEST_CONFIG volume-feature-enabled backup False
498431
fi
@@ -573,6 +506,76 @@ function configure_tempest {
573506
iniset $TEMPEST_CONFIG service_available cinder "False"
574507
fi
575508

509+
# Run tempest configuration utilities. This must be done last during configuration to
510+
# ensure as complete a config as possible already exists
511+
512+
# NOTE(mtreinish): Respect constraints on tempest verify-config venv
513+
local tmp_cfg_file
514+
tmp_cfg_file=$(mktemp)
515+
cd $TEMPEST_DIR
516+
if [[ "$OFFLINE" != "True" ]]; then
517+
tox -revenv --notest
518+
fi
519+
tox -evenv -- pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
520+
521+
# Auth:
522+
iniset $TEMPEST_CONFIG auth tempest_roles "Member"
523+
if [[ $TEMPEST_USE_TEST_ACCOUNTS == "True" ]]; then
524+
if [[ $TEMPEST_HAS_ADMIN == "True" ]]; then
525+
tox -evenv -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY --with-admin etc/accounts.yaml
526+
else
527+
tox -evenv -- tempest-account-generator -c $TEMPEST_CONFIG --os-username $admin_username --os-password "$password" --os-tenant-name $admin_project_name -r $TEMPEST_CONCURRENCY etc/accounts.yaml
528+
fi
529+
iniset $TEMPEST_CONFIG auth use_dynamic_credentials False
530+
iniset $TEMPEST_CONFIG auth test_accounts_file "etc/accounts.yaml"
531+
elif [[ $TEMPEST_HAS_ADMIN == "False" ]]; then
532+
iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-False}
533+
534+
else
535+
iniset $TEMPEST_CONFIG auth use_dynamic_credentials ${TEMPEST_ALLOW_TENANT_ISOLATION:-True}
536+
fi
537+
538+
# API Extensions
539+
# Run ``verify_tempest_config -ur`` to retrieve enabled extensions on API endpoints
540+
# NOTE(mtreinish): This must be done after auth settings are added to the tempest config
541+
tox -evenv -- tempest verify-config -uro $tmp_cfg_file
542+
# Nova API extensions
543+
local compute_api_extensions=${COMPUTE_API_EXTENSIONS:-"all"}
544+
if [[ ! -z "$DISABLE_COMPUTE_API_EXTENSIONS" ]]; then
545+
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
546+
compute_api_extensions=${COMPUTE_API_EXTENSIONS:-$(iniget $tmp_cfg_file compute-feature-enabled api_extensions | tr -d " ")}
547+
# Remove disabled extensions
548+
compute_api_extensions=$(remove_disabled_extensions $compute_api_extensions $DISABLE_COMPUTE_API_EXTENSIONS)
549+
fi
550+
iniset $TEMPEST_CONFIG compute-feature-enabled api_extensions $compute_api_extensions
551+
# Neutron API Extensions
552+
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
553+
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
554+
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
555+
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
556+
# Remove disabled extensions
557+
network_api_extensions=$(remove_disabled_extensions $network_api_extensions $DISABLE_NETWORK_API_EXTENSIONS)
558+
fi
559+
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
560+
# Swift API Extensions
561+
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
562+
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
563+
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
564+
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
565+
# Remove disabled extensions
566+
object_storage_api_extensions=$(remove_disabled_extensions $object_storage_api_extensions $DISABLE_STORAGE_API_EXTENSIONS)
567+
fi
568+
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
569+
# Cinder API Extensions
570+
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
571+
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
572+
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
573+
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
574+
# Remove disabled extensions
575+
volume_api_extensions=$(remove_disabled_extensions $volume_api_extensions $DISABLE_VOLUME_API_EXTENSIONS)
576+
fi
577+
iniset $TEMPEST_CONFIG volume-feature-enabled api_extensions $volume_api_extensions
578+
576579
# Restore IFS
577580
IFS=$ifs
578581
}

0 commit comments

Comments
 (0)