summaryrefslogtreecommitdiff
path: root/ctdb/tests/simple/08_ctdb_isnotrecmaster.sh
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-04-11 20:55:20 +1000
committerAmitay Isaacs <amitay@samba.org>2019-05-07 05:45:35 +0000
commit066cc5b0c561464ed08890d9aa1a1a55b545e9cc (patch)
tree50469868775459c9e807800257d809218c11f39f /ctdb/tests/simple/08_ctdb_isnotrecmaster.sh
parent9d02452a24625df5f62fd6d45a16effe2fa45fbe (diff)
downloadsamba-066cc5b0c561464ed08890d9aa1a1a55b545e9cc.tar.gz
ctdb-tests: Avoid bulk output in $out, prefer $outfile
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>
Diffstat (limited to 'ctdb/tests/simple/08_ctdb_isnotrecmaster.sh')
-rwxr-xr-xctdb/tests/simple/08_ctdb_isnotrecmaster.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/ctdb/tests/simple/08_ctdb_isnotrecmaster.sh b/ctdb/tests/simple/08_ctdb_isnotrecmaster.sh
index 12c8164b223..68e22879ba3 100755
--- a/ctdb/tests/simple/08_ctdb_isnotrecmaster.sh
+++ b/ctdb/tests/simple/08_ctdb_isnotrecmaster.sh
@@ -33,13 +33,11 @@ set -e
cluster_is_healthy
cmd="$CTDB isnotrecmaster || true"
-try_command_on_node all "$cmd"
-echo "Output of \"$cmd\":"
-echo "$out"
+try_command_on_node -v all "$cmd"
-num_all_lines=$(echo "$out" | wc -l)
-num_rm_lines=$(echo "$out" | fgrep -c 'this node is the recmaster') || true
-num_not_rm_lines=$(echo "$out" | fgrep -c 'this node is not the recmaster') || true
+num_all_lines=$(wc -l <"$outfile")
+num_rm_lines=$(grep -Fc 'this node is the recmaster' "$outfile") || true
+num_not_rm_lines=$(grep -Fc 'this node is not the recmaster' "$outfile") || true
if [ $num_rm_lines -eq 1 ] ; then
echo "OK, there is only 1 recmaster"