summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-05-13 17:40:15 +1000
committerKarolin Seeger <kseeger@samba.org>2019-05-17 07:18:30 +0000
commit0ffba5145c8baafd176ca5e38d08b433f064aecb (patch)
tree713abbfe80df08e05362b4cbdeb7784c50f4da3b /ctdb
parent1eb5d2e4fc2895ea2a6ad081407dd624bc97ec36 (diff)
downloadsamba-0ffba5145c8baafd176ca5e38d08b433f064aecb.tar.gz
ctdb-tests: Capture output in $out on failure as well
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13924 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit cf00db40355b49443263187f9d97934f91287e51)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/tests/scripts/integration.bash8
1 files changed, 5 insertions, 3 deletions
diff --git a/ctdb/tests/scripts/integration.bash b/ctdb/tests/scripts/integration.bash
index 0fbd39daec8..e0aa312192b 100644
--- a/ctdb/tests/scripts/integration.bash
+++ b/ctdb/tests/scripts/integration.bash
@@ -109,7 +109,11 @@ try_command_on_node ()
local cmd="$*"
- if ! onnode -q $onnode_opts "$nodespec" "$cmd" >"$outfile" 2>&1 ; then
+ local status=0
+ onnode -q $onnode_opts "$nodespec" "$cmd" >"$outfile" 2>&1 || status=$?
+ out=$(dd if="$outfile" bs=1k count=1 2>/dev/null)
+
+ if [ $status -ne 0 ] ; then
echo "Failed to execute \"$cmd\" on node(s) \"$nodespec\""
cat "$outfile"
return 1
@@ -119,8 +123,6 @@ try_command_on_node ()
echo "Output of \"$cmd\":"
cat "$outfile"
fi
-
- out=$(dd if="$outfile" bs=1k count=1 2>/dev/null)
}
sanity_check_output ()