summaryrefslogtreecommitdiffstats
path: root/tests/adhoc/smoke01-clean.sh
diff options
context:
space:
mode:
authorBryan Sullivan <bs3131@att.com>2015-12-14 08:26:03 -0800
committerBryan Sullivan <bs3131@att.com>2015-12-14 08:26:03 -0800
commit39478740801049201d3fa9164dcfabdada3ce5f2 (patch)
tree3c6d918a57333235b159dffecb63a1df7c602cd3 /tests/adhoc/smoke01-clean.sh
parent4e0e350fedfc164ddef3037340ac1250c6065d4c (diff)
Initial versions of adhoc tests and test server setup
JIRA: COPPER-4 Change-Id: Ia999801b5782642aa7044983268ba1e6cc256c5c Signed-off-by: Bryan Sullivan <bs3131@att.com>
Diffstat (limited to 'tests/adhoc/smoke01-clean.sh')
-rw-r--r--tests/adhoc/smoke01-clean.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/adhoc/smoke01-clean.sh b/tests/adhoc/smoke01-clean.sh
new file mode 100644
index 0000000..c50d667
--- /dev/null
+++ b/tests/adhoc/smoke01-clean.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+set -x #echo on
+
+instance=$(nova list | awk "/ cirros1 / { print \$2 }")
+if [ "$instance" != "" ]; then nova delete $instance
+fi
+
+instance=$(nova list | awk "/ cirros2 / { print \$2 }")
+if [ "$instance" != "" ]; then nova delete $instance
+fi
+
+router=$(neutron router-list | awk "/ external / { print \$2 }")
+
+internal_interface=$(neutron router-port-list $router | grep 10.0.0.1 | awk '{print $2}')
+
+if [ "$internal_interface" != "" ]; then neutron router-interface-delete $router port=$internal_interface
+fi
+
+public_interface=$(neutron router-port-list $router | grep 191.168.10.2 | awk '{print $2}')
+
+if [ "$public_interface" != "" ]; then neutron router-interface-delete $router port=$public_interface
+fi
+
+neutron router-interface-delete $router $internal_interface
+
+neutron router-gateway-clear external
+
+neutron router-delete external
+
+port=$(neutron port-list | awk "/ 10.0.0.1 / { print \$2 }")
+
+if [ "$port" != "" ]; then neutron port-delete $port
+fi
+
+port=$(neutron port-list | awk "/ 10.0.0.2 / { print \$2 }")
+
+if [ "$port" != "" ]; then neutron port-delete $port
+fi
+
+neutron subnet-delete internal
+
+neutron net-delete internal
+
+neutron subnet-delete public
+
+neutron net-delete public
+
+set +x #echo off