diff options
Diffstat (limited to 'tests/dmz-clean.sh')
-rw-r--r-- | tests/dmz-clean.sh | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/dmz-clean.sh b/tests/dmz-clean.sh index 32302a2..6859192 100644 --- a/tests/dmz-clean.sh +++ b/tests/dmz-clean.sh @@ -22,7 +22,7 @@ # Install Congress test server per https://wiki.opnfv.org/copper/academy # $ source ~/git/copper/tests/adhoc/dmz.sh # After test, cleanup with -# $ sh ~/git/copper/tests/adhoc/dmz-clean.sh +# $ bash ~/git/copper/tests/adhoc/dmz-clean.sh if [ $# -eq 1 ]; then if [ $1 == "debug" ]; then @@ -43,13 +43,11 @@ fi echo "Delete cirros1 instance" instance=$(nova list | awk "/ cirros1 / { print \$2 }") -if [ "$instance" != "" ]; then nova delete $instance -fi +if [ "$instance" != "" ]; then nova delete $instance; fi echo "Delete cirros2 instance" instance=$(nova list | awk "/ cirros2 / { print \$2 }") -if [ "$instance" != "" ]; then nova delete $instance -fi +if [ "$instance" != "" ]; then nova delete $instance; fi echo "Delete 'dmz' security group" sg=$(neutron security-group-list | awk "/ dmz / { print \$2 }") @@ -62,15 +60,13 @@ echo "Get internal port ID with subnet 10.0.0.1 on 'test_router'" test_internal_interface=$(neutron router-port-list $router | grep 10.0.0.1 | awk '{print $2}') echo "If found, delete the port with subnet 10.0.0.1 on 'test_router'" -if [ "$test_internal_interface" != "" ]; then neutron router-interface-delete $router port=$test_internal_interface -fi +if [ "$test_internal_interface" != "" ]; then neutron router-interface-delete $router port=$test_internal_interface; fi echo "Get public port ID with fixed_ip 192.168.10.2 on 'test_router'" test_public_interface=$(neutron router-port-list $router | grep 192.168.10.2 | awk '{print $2}') echo "If found, delete the port with fixed_ip 192.168.10.2 on 'test_router'" -if [ "$test_public_interface" != "" ]; then neutron router-interface-delete $router port=$test_public_interface -fi +if [ "$test_public_interface" != "" ]; then neutron router-interface-delete $router port=$test_public_interface; fi echo "Delete the router internal interface" neutron router-interface-delete $router $test_internal_interface @@ -83,13 +79,11 @@ neutron router-delete test_router echo "Delete neutron port with fixed_ip 10.0.0.1" port=$(neutron port-list | awk "/ 10.0.0.1 / { print \$2 }") -if [ "$port" != "" ]; then neutron port-delete $port -fi +if [ "$port" != "" ]; then neutron port-delete $port; fi echo "Delete neutron port with fixed_ip 10.0.0.2" port=$(neutron port-list | awk "/ 10.0.0.2 / { print \$2 }") -if [ "$port" != "" ]; then neutron port-delete $port -fi +if [ "$port" != "" ]; then neutron port-delete $port; fi echo "Delete internal subnet" neutron subnet-delete test_internal @@ -103,4 +97,3 @@ neutron subnet-delete test_public echo "Delete public network" neutron net-delete test_public -set +x #echo off |