summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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