From: Martin Schwenke Date: Thu, 4 Jul 2024 05:17:25 +0000 (+1000) Subject: ctdb-tests: Replace implicit healthy behaviour with early exits X-Git-Tag: tdb-1.4.13~1334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b2f228198b558325ece2f32516776db6a322282;p=thirdparty%2Fsamba.git ctdb-tests: Replace implicit healthy behaviour with early exits The early exits from the sub-shell make the obvious successes much more obvious, and slightly simplify the code that follows. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh index af817d8d30b..ae295df85b1 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh @@ -342,7 +342,8 @@ rpc_set_service_failure_response() if rpcinfo -T tcp localhost "$_rpc_service" \ >/dev/null 2>&1; then - _numfails=0 + echo 0 >"$_failcount_file" + exit # from subshell elif nfs_stats_check_changed \ "$_rpc_service" "$_iteration"; then @@ -351,7 +352,8 @@ rpc_set_service_failure_response() "$_rpc_service" \ "$_ver" \ >"$_out" - _numfails=0 + echo 0 >"$_failcount_file" + exit # from subshell else _numfails=$((_numfails + 1)) fi @@ -371,7 +373,6 @@ rpc_set_service_failure_response() fi if [ $restart_every -gt 0 ] && - [ $_numfails -gt 0 ] && [ $((_numfails % restart_every)) -eq 0 ]; then if ! $_unhealthy; then rpc_failure \