From 92f17474484a975cef529b9b591f7cad9c66231f Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 3 Jul 2023 12:10:28 +1000 Subject: [PATCH] ctdb-tests: Avoid ShellCheck warning SC2086 SC2086 Double quote to prevent globbing and word splitting. Apparently ShellCheck is more picky about some of these than it used to be. Signed-off-by: Martin Schwenke Reviewed-by: Andreas Schneider --- ctdb/tests/local_daemons.sh | 4 ++-- ctdb/tests/run_tests.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ctdb/tests/local_daemons.sh b/ctdb/tests/local_daemons.sh index 71cf493fed3..b4746681c1f 100755 --- a/ctdb/tests/local_daemons.sh +++ b/ctdb/tests/local_daemons.sh @@ -193,7 +193,7 @@ local_daemons_setup () else setup_public_addresses "$_num_nodes" \ $_node_no_ips \ - $_use_ipv6 >"$_public_addresses_all" + "$_use_ipv6" >"$_public_addresses_all" fi _cluster_lock_dir="${directory}/shared/.ctdb" @@ -226,7 +226,7 @@ local_daemons_setup () _public_addresses="${CTDB_BASE}/public_addresses" if [ -z "$_public_addresses_file" ] && \ - [ $_node_no_ips -eq "$_n" ] ; then + [ "$_node_no_ips" -eq "$_n" ] ; then echo "Node ${_n} will have no public IPs." : >"$_public_addresses" else diff --git a/ctdb/tests/run_tests.sh b/ctdb/tests/run_tests.sh index ff431f8831f..dfe2a9ab364 100755 --- a/ctdb/tests/run_tests.sh +++ b/ctdb/tests/run_tests.sh @@ -300,8 +300,8 @@ run_tests () die "test \"$f\" is not recognised" fi - if $exit_on_fail && [ $status -ne 0 ] ; then - return $status + if $exit_on_fail && [ "$status" -ne 0 ] ; then + return "$status" fi done } @@ -371,7 +371,7 @@ while [ "$max_iterations" -eq 0 ] || [ $iterations -lt "$max_iterations" ] ; do done if $with_summary ; then - if [ $status -eq 0 ] || ! $exit_on_fail ; then + if [ "$status" -eq 0 ] || ! $exit_on_fail ; then echo cat "$summary_file" @@ -391,7 +391,7 @@ echo do_cleanup if $no_header || $exit_on_fail ; then - exit $status + exit "$status" elif [ $tests_failed -gt 0 ] ; then exit 1 else -- 2.11.4.GIT