From: Martin Schwenke Date: Mon, 16 Sep 2019 09:08:11 +0000 (+1000) Subject: ctdb-tests: Use ctdb_get_all_pnns() X-Git-Tag: talloc-2.3.1~850 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=68684377c6970725a57ec6111cb165736468440f;p=thirdparty%2Fsamba.git ctdb-tests: Use ctdb_get_all_pnns() The nested, arbitrary use of onnode can cause messages from ssh on stderr to appear in the node list: Getting list of nodes... Output of "onnode -pq all ctdb pnn | grep '^[0-9][0-9]*$'": Warning: Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M Warning: Permanently added '10.0.0.75' (RSA) to the list of known hosts.^M Warning: Permanently added '10.0.0.73' (RSA) to the list of known hosts.^M Warning: Permanently added '10.0.0.74' (RSA) to the list of known hosts.^M 1 0 3 2 Create/wipe test database rec_test.tdb Failed to execute "Permanently added '10.0.0.72' (RSA) to the list of known hosts.^M ctdb attach rec_test.tdb" on node(s) "Warning:" Invalid Avoid that by using an existing function that does not nest ssh uses. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/simple/69_recovery_resurrect_deleted.sh b/ctdb/tests/simple/69_recovery_resurrect_deleted.sh index f6c72c59f2a..e5615cddb86 100755 --- a/ctdb/tests/simple/69_recovery_resurrect_deleted.sh +++ b/ctdb/tests/simple/69_recovery_resurrect_deleted.sh @@ -18,11 +18,11 @@ cluster_is_healthy testdb="rec_test.tdb" echo "Getting list of nodes..." -try_command_on_node -v any "onnode -pq all ctdb pnn | grep '^[0-9][0-9]*$'" +ctdb_get_all_pnns -first=$(sed -n -e '1p' "$outfile") -second=$(sed -n -e '2p' "$outfile") -notfirst=$(tail -n +2 "$outfile") +first=$(echo "$all_pnns" | sed -n -e '1p') +second=$(echo "$all_pnns" | sed -n -e '2p') +notfirst=$(echo "$all_pnns" | tail -n +2) echo "Create/wipe test database ${testdb}" try_command_on_node $first $CTDB attach "$testdb"