1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

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>
This commit is contained in:
Martin Schwenke 2019-05-13 17:40:15 +10:00 committed by Amitay Isaacs
parent b1a32dd7f5
commit cf00db4035

View File

@ -104,7 +104,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
@ -114,8 +118,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 ()