summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2018-02-15 11:28:50 -0800
committerGary Wu <gary.i.wu@huawei.com>2018-02-15 19:35:31 +0000
commit13709eaa9e5b39442cfb1392decbc083be8354fe (patch)
tree20feae489c792dba806021bfdd3f3297a395ba9a
parent104a07ec59ff4422bae4f3b4a4cc6c6415bd6467 (diff)
Explicit check for DNS zone project ID in teardown
TLAB Designate configuration currently does not support project-specific DNS zones. This modifies the teardown script to avoid deleting such noauth-project DNS zones. In practice this means that no TLAB DNS zones will ever be deleted during teardown until TLAB fixes its Designate configuration. Change-Id: I43be641e4653270fd31b1a4daf9f16d4afee05ab Issue-ID: INT-414 Signed-off-by: Gary Wu <gary.i.wu@huawei.com>
-rwxr-xr-xtest/ete/scripts/teardown-onap.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ete/scripts/teardown-onap.sh b/test/ete/scripts/teardown-onap.sh
index dbbee2816..3a40cfac8 100755
--- a/test/ete/scripts/teardown-onap.sh
+++ b/test/ete/scripts/teardown-onap.sh
@@ -11,10 +11,13 @@ source $WORKSPACE/test/ete/scripts/install_openstack_cli.sh
# $WORKSPACE/test/ete/scripts/dns-zones/delete-dns-zones.sh $OS_PROJECT_NAME
# sleep 1
-# delete all Desigate DNS zones
+# delete all Desigate DNS zones belonging to this project
ZONES=$(openstack zone list -c "id" -f value)
for ZONE in ${ZONES}; do
- openstack zone delete $ZONE
+ ZONE_PROJECT_ID=$(openstack zone show $ZONE -f json | jq -r '.project_id')
+ if [ "$OS_PROJECT_ID" == "$ZONE_PROJECT_ID" ]; then
+ openstack zone delete $ZONE
+ fi
done
# delete all instances
@@ -31,7 +34,7 @@ for ROUTER in $ROUTERS; do
echo $ROUTER;
PORTS=$(openstack router show $ROUTER -c "interfaces_info" -f "value" | jq -r '.[].port_id')
for PORT in $PORTS; do
- openstack router remove port $ROUTER $PORT
+ openstack router remove port $ROUTER $PORT
done
openstack router delete $ROUTER
done