From 68ed549721f2688df2f28c047eaa64d97b2f511e Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Mon, 24 Jun 2024 22:27:05 +0530 Subject: [PATCH] Add group create option in horizontest image --- .../tcib/base/os/horizontest/run_horizontest.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/container-images/tcib/base/os/horizontest/run_horizontest.sh b/container-images/tcib/base/os/horizontest/run_horizontest.sh index 80e7f75..a3b95c8 100644 --- a/container-images/tcib/base/os/horizontest/run_horizontest.sh +++ b/container-images/tcib/base/os/horizontest/run_horizontest.sh @@ -11,6 +11,7 @@ PROJECT_NAME=horizontest USER_NAME=horizontest PASSWORD=horizontest FLAVOR_NAME=m1.tiny +GROUP_NAME=admins # assert mandatory variables have been set [[ -z ${ADMIN_USERNAME} ]] && echo "ADMIN_USERNAME not set" && exit 1 @@ -56,6 +57,11 @@ function create_custom_resources { --public ${FLAVOR_NAME} \ --ram 512 --disk 1 --vcpus 1 fi + + if ! openstack group show --os-cloud default ${GROUP_NAME}; then + openstack group create \ + --os-cloud default ${GROUP_NAME} + fi } function delete_custom_resources { @@ -78,6 +84,11 @@ function delete_custom_resources { openstack flavor delete \ --os-cloud default ${FLAVOR_NAME} fi + + if openstack group show --os-cloud default ${GROUP_NAME}; then + openstack group delete \ + --os-cloud default ${GROUP_NAME} + fi } pushd ${HORIZONTEST_DIR}