From 81ab269436f009075d1d82f48c40eb8dc7935b75 Mon Sep 17 00:00:00 2001 From: songwenping Date: Mon, 22 Jan 2024 15:42:01 +0800 Subject: [PATCH] Add tempest config for devstack Change-Id: If8a390aedaf3c2cfcf491a39daac5a2e636ec529 --- devstack/lib/cyborg | 14 ++++++++++---- devstack/plugin.sh | 8 ++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/devstack/lib/cyborg b/devstack/lib/cyborg index 2f59a7d4..549e7ca8 100644 --- a/devstack/lib/cyborg +++ b/devstack/lib/cyborg @@ -272,12 +272,18 @@ function stop_cyborg { stop_process cyborg-agent } +function cyborg_configure_tempest { + iniset $TEMPEST_CONFIG service_available cyborg True + + if [[ -n "$TEMPEST_ACCELERATOR_MIN_MICROVERSION" ]]; then + iniset $TEMPEST_CONFIG accelerator min_microversion $TEMPEST_ACCELERATOR_MIN_MICROVERSION + fi + if [[ -n "$TEMPEST_ACCELERATOR_MAX_MICROVERSION" ]]; then + iniset $TEMPEST_CONFIG accelerator max_microversion $TEMPEST_ACCELERATOR_MAX_MICROVERSION + fi +} # Restore xtrace + pipefail $_XTRACE_CYBORG $_PIPEFAIL_CYBORG -# Tell emacs to use shell-script-mode -## Local variables: -## mode: shell-script -## End: diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 0b9e0e31..041271a1 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -35,6 +35,14 @@ case $1 in echo_summary "Starting Cyborg" start_cyborg ;; + "test-config") + # stack/test-config - Called at the end of devstack used to configure tempest + # or any other test environments + if is_service_enabled tempest; then + echo_summary "Configuring Tempest for Cyborg needs" + cyborg_configure_tempest + fi + ;; esac ;; "unstack")