summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbryan <bryan.sullivan@att.com>2017-02-07 08:36:44 -0800
committerbryan <bryan.sullivan@att.com>2017-02-07 08:36:44 -0800
commit5da1f1a0a2aa7423189b87e3c732e9c97c6783c6 (patch)
treebf0ff33958809f2d837774766faffe79f7d772b7
parenta6d0b8903f8b0bfac624a2391a83a50e109f6298 (diff)
Add fail trap and success functions to smtp_ingress test
Change-Id: Id450f20f9d4f6773bc7c75ca2f1a1ae99ec5ab29 Signed-off-by: bryan <bryan.sullivan@att.com>
-rw-r--r--tests/smtp_ingress-clean.sh18
-rw-r--r--tests/smtp_ingress.sh2
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/smtp_ingress-clean.sh b/tests/smtp_ingress-clean.sh
index 0cf7943..791a979 100644
--- a/tests/smtp_ingress-clean.sh
+++ b/tests/smtp_ingress-clean.sh
@@ -27,6 +27,22 @@
# # After test, cleanup with
# $ bash dmz-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
@@ -89,4 +105,4 @@ neutron subnet-delete test_internal
echo "Delete internal network"
neutron net-delete test_internal
-set +x #echo off
+pass
diff --git a/tests/smtp_ingress.sh b/tests/smtp_ingress.sh
index a6ee632..0e6f1ce 100644
--- a/tests/smtp_ingress.sh
+++ b/tests/smtp_ingress.sh
@@ -165,6 +165,4 @@ done
echo $RESULT
if [ "$RESULT" == "Test Failed!" ]; then fail; fi
-set +x #echo off
-
pass