summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2015-03-05 13:11:46 +1100
committerMartin Schwenke <martins@samba.org>2015-03-05 07:16:54 +0100
commit956d1dbfd91615032de337b0d84b40c16657b8c1 (patch)
treeac500df5737afdb9459ded38ee73ed2e545cb43b /ctdb
parent956e51707d7ddcff060352f54d11ff42bdcc51ef (diff)
downloadsamba-956d1dbfd91615032de337b0d84b40c16657b8c1.tar.gz
samba-956d1dbfd91615032de337b0d84b40c16657b8c1.tar.xz
samba-956d1dbfd91615032de337b0d84b40c16657b8c1.zip
ctdb-tests: Correctly cascade test failures from the end of pipes
Some eventscript unit test failures get lost because _passed=false is set in the tail of a pipe. Add a new function test_fail() and call it when necessary to ensure the value of _passed is set correctly. Signed-off-by: Amitay Isaacs <amitay@gmail.com> Pair-programmed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Martin Schwenke <martin@meltin.net> Autobuild-User(master): Martin Schwenke <martins@samba.org> Autobuild-Date(master): Thu Mar 5 07:16:54 CET 2015 on sn-devel-104
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/eventscripts/scripts/local.sh6
-rw-r--r--ctdb/tests/scripts/unit.sh6
2 files changed, 9 insertions, 3 deletions
diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh
index fe4ae1eec3..ed99985b8e 100644
--- a/ctdb/tests/eventscripts/scripts/local.sh
+++ b/ctdb/tests/eventscripts/scripts/local.sh
@@ -533,7 +533,7 @@ default via $_gw dev $_dev "
EOF
simple_test_command dump_routes
- }
+ } || test_fail
}
######################################################################
@@ -569,7 +569,7 @@ check_ctdb_tdb_statd_state ()
ctdb_catdb_format_pairs | {
ok
simple_test_command ctdb catdb ctdb.tdb
- }
+ } || test_fail
}
check_statd_callout_smnotify ()
@@ -592,7 +592,7 @@ EOF
done | {
ok
simple_test_event "notify"
- }
+ } || test_fail
}
######################################################################
diff --git a/ctdb/tests/scripts/unit.sh b/ctdb/tests/scripts/unit.sh
index 38b7e21c8c..44675ae1c7 100644
--- a/ctdb/tests/scripts/unit.sh
+++ b/ctdb/tests/scripts/unit.sh
@@ -150,6 +150,12 @@ result_check ()
result_footer "$_passed"
}
+test_fail ()
+{
+ _passed=false
+ return 1
+}
+
local="${TEST_SUBDIR}/scripts/local.sh"
if [ -r "$local" ] ; then
. "$local"