ctdb-tests: Avoid shellcheck warnings
authorMartin Schwenke <martin@meltin.net>
Mon, 8 Aug 2022 08:19:34 +0000 (18:19 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 25 Aug 2022 16:15:45 +0000 (16:15 +0000)
Mostly

  SC2086: Double quote to prevent globbing and word splitting.

Use ctdb_onnode() where it simplifies code.  No behaviour changes
intended.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Aug 25 16:15:45 UTC 2022 on sn-devel-184

ctdb/tests/CLUSTER/complex/11_ctdb_delip_removes_ip.sh

index 77e59f8c927dd96dcc6f096b6bdc1bb95feb427c..072780ac2159f21af20a4d66a249de1d0af7466a 100755 (executable)
@@ -20,13 +20,15 @@ ctdb_test_init
 
 select_test_node_and_ips
 
+# $test_node and $test_ip set by select_test_node_and_ips()
+# shellcheck disable=SC2154
 echo "Checking that node ${test_node} hosts ${test_ip}..."
 test_node_has_test_ip
 
 echo "Attempting to remove ${test_ip} from node ${test_node}."
-try_command_on_node $test_node $CTDB delip $test_ip
-try_command_on_node $test_node $CTDB ipreallocate
-wait_until_ips_are_on_node '!' $test_node $test_ip
+ctdb_onnode "$test_node" "delip ${test_ip}"
+ctdb_onnode "$test_node" "ipreallocate"
+wait_until_ips_are_on_node '!' "$test_node" "$test_ip"
 
 echo "Waiting for ${test_ip} to disappear from node ${test_node}..."
 wait_until 60/5 '!' test_node_has_test_ip