summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbryan <bryan.sullivan@att.com>2017-02-07 08:24:32 -0800
committerbryan <bryan.sullivan@att.com>2017-02-07 08:24:32 -0800
commita6d0b8903f8b0bfac624a2391a83a50e109f6298 (patch)
tree7ce8f39ae981e68c883e40903b4b368dbcd69aae
parentfed22cace3e087762d6110c51a252891a4640f3b (diff)
Add fail trap and success functions to reserved_subnet test
JIRA: COPPER-4 Change-Id: I50c65540662ce2d4bcd7852870ebb850a42d9ec7 Signed-off-by: bryan <bryan.sullivan@att.com>
-rw-r--r--tests/reserved_subnet-clean.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/reserved_subnet-clean.sh b/tests/reserved_subnet-clean.sh
index abc4e7e..778a027 100644
--- a/tests/reserved_subnet-clean.sh
+++ b/tests/reserved_subnet-clean.sh
@@ -30,6 +30,22 @@
# # After test, cleanup
# $ bash reserved_subnet-clean.sh
+trap 'fail' ERR
+
+pass() {
+ echo "Hooray!"
+ set +x #echo off
+ exit 0
+}
+
+# Use this to trigger fail() at the right places
+# if [ "$RESULT" == "Test Failed!" ]; then fail; fi
+fail() {
+ echo "Test Failed!"
+ set +x
+ exit 1
+}
+
if [ $# -eq 1 ]; then
if [ $1 == "debug" ]; then
set -x #echo on
@@ -57,4 +73,4 @@ neutron subnet-delete test_public
echo "Delete public network"
neutron net-delete test_public
-set +x #echo off
+pass