From b17b378390579b3ba6b70076464ba732c0a7f3bf Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Sat, 21 Sep 2019 20:11:36 -0500 Subject: [PATCH] Add rally clean up script This patch set adds in a script that cleans up orphaned or lingering rally helm test pods. Depends-On: https://review.opendev.org/#/c/683759/ Change-Id: I94fc8d067b421248cf74fe40b2e8520f63d4417c Signed-off-by: Tin Lam --- cinder/values.yaml | 5 +++++ nova/values.yaml | 9 +++++++++ tools/deployment/component/cinder/cinder.sh | 4 ++++ tools/deployment/component/compute-kit/compute-kit.sh | 8 ++++++++ tools/deployment/component/keystone/keystone.sh | 4 ++++ 5 files changed, 30 insertions(+) diff --git a/cinder/values.yaml b/cinder/values.yaml index d530679a2e..f3f0d77793 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -958,6 +958,11 @@ conf: rbd_secret_uuid: 457eb676-33da-42ec-9a8c-9293d545c337 rally_tests: run_tempest: false + clean_up: | + VOLUMES=$(openstack volume list -f value | grep -e "^s_rally_" | awk '{ print $1 }') + if [ -n "$VOLUMES" ]; then + echo $VOLUMES | xargs openstack volume delete + fi tests: CinderVolumes.create_and_delete_volume: - args: diff --git a/nova/values.yaml b/nova/values.yaml index ea62d9bac6..e65b7cb9a4 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -618,6 +618,15 @@ conf: ssh_public: 'null' rally_tests: run_tempest: false + clean_up: | + FLAVORS=$(openstack flavor list -f value | grep -e "^s_rally_" | awk '{ print $1 }') + if [ -n "$FLAVORS" ]; then + echo $FLAVORS | xargs openstack flavor delete + fi + SERVERS=$(openstack server list -f value | grep -e "^s_rally_" | awk '{ print $1 }') + if [ -n "$SERVERS" ]; then + echo $SERVERS | xargs openstack server delete + fi tests: NovaAgents.list_agents: - runner: diff --git a/tools/deployment/component/cinder/cinder.sh b/tools/deployment/component/cinder/cinder.sh index 1ed53e2901..5a419ffe0a 100755 --- a/tools/deployment/component/cinder/cinder.sh +++ b/tools/deployment/component/cinder/cinder.sh @@ -74,3 +74,7 @@ openstack service list sleep 30 #NOTE(portdirect): Wait for ingress controller to update rules and restart Nginx openstack volume type list openstack volume type list --default + +# Delete the test pod if it still exists +kubectl delete pods -l application=cinder,release_group=cinder,component=test --namespace=openstack --ignore-not-found +helm test cinder --timeout 900 diff --git a/tools/deployment/component/compute-kit/compute-kit.sh b/tools/deployment/component/compute-kit/compute-kit.sh index 2c465fa7ae..0e0ea746ff 100755 --- a/tools/deployment/component/compute-kit/compute-kit.sh +++ b/tools/deployment/component/compute-kit/compute-kit.sh @@ -91,3 +91,11 @@ sleep 30 #NOTE(portdirect): Wait for ingress controller to update rules and rest openstack compute service list openstack network agent list openstack hypervisor list + +# Delete the test pods if they still exist +kubectl delete pods -l application=nova,release_group=nova,component=test --namespace=openstack --ignore-not-found +kubectl delete pods -l application=neutron,release_group=neutron,component=test --namespace=openstack --ignore-not-found + +timeout=${OSH_TEST_TIMEOUT:-900} +helm test nova --timeout $timeout +helm test neutron --timeout $timeout diff --git a/tools/deployment/component/keystone/keystone.sh b/tools/deployment/component/keystone/keystone.sh index fcee81c712..d376e9df9b 100755 --- a/tools/deployment/component/keystone/keystone.sh +++ b/tools/deployment/component/keystone/keystone.sh @@ -60,3 +60,7 @@ FEATURE_GATE="ldap"; if [[ ${FEATURE_GATES//,/ } =~ (^|[[:space:]])${FEATURE_GAT -H "X-Auth-Token: $token" \ http://keystone.openstack.svc.cluster.local/v3/domains/${domainId}/config fi + +# Delete the test pod if it still exists +kubectl delete pods -l application=keystone,release_group=keystone,component=test --namespace=openstack --ignore-not-found +helm test keystone --timeout 900