summaryrefslogtreecommitdiffstats
path: root/tests/dmz-clean.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dmz-clean.sh')
-rw-r--r--tests/dmz-clean.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/dmz-clean.sh b/tests/dmz-clean.sh
index b13ef7e..9161d69 100644
--- a/tests/dmz-clean.sh
+++ b/tests/dmz-clean.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 2015-2016 AT&T Intellectual Property, Inc
+# Copyright 2015-2017 AT&T Intellectual Property, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -28,6 +28,22 @@
# # After test, cleanup
# $ 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
@@ -101,5 +117,5 @@ neutron subnet-delete test_internal
echo "Delete internal network"
neutron net-delete test_internal
-set +x #echo off
+pass