Only teardown items in active OpenStack tenant
Change-Id: I8de4507a18554fbf9a837eece1fba2aa5280cec8
Issue-ID: INT-611
Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
diff --git a/test/ete/scripts/teardown-onap.sh b/test/ete/scripts/teardown-onap.sh
index 77b8233..4dad43e 100755
--- a/test/ete/scripts/teardown-onap.sh
+++ b/test/ete/scripts/teardown-onap.sh
@@ -51,14 +51,14 @@
sleep 10
# delete all instances
- openstack server delete $(openstack server list -c ID -f value)
+ openstack server delete $(openstack server list -c ID -f value --project $OS_PROJECT_ID)
sleep 1
# miscellaneous cleanup
- openstack floating ip delete $(openstack floating ip list -c ID -f value)
+ openstack floating ip delete $(openstack floating ip list -c ID -f value --project $OS_PROJECT_ID)
sleep 1
- ROUTERS=$(openstack router list -c ID -f value)
+ ROUTERS=$(openstack router list -c ID -f value --project $OS_PROJECT_ID)
echo $ROUTERS
for ROUTER in $ROUTERS; do
echo $ROUTER;
@@ -69,11 +69,11 @@
openstack router delete $ROUTER
done
- openstack port delete $(openstack port list -f value -c ID)
- openstack volume delete $(openstack volume list -f value -c ID)
+ openstack port delete $(openstack port list -f value -c ID --project $OS_PROJECT_ID)
+ openstack volume delete $(openstack volume list -f value -c ID --project $OS_PROJECT_ID)
# delete all except "default" security group
- SECURITY_GROUPS=$(openstack security group list -c ID -f value | grep -v default)
+ SECURITY_GROUPS=$(openstack security group list -c ID -f value --project $OS_PROJECT_ID | grep -v default)
openstack security group delete $SECURITY_GROUPS
sleep 1