1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

ctdb-tests: Drop unreachable code

This generates ShellCheck warnings:

In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 412:
			if [ -n "$service_check_cmd" ]; then
                                 ^----------------^ SC2031 (info): service_check_cmd was modified in a subshell. That change might be lost.

In ./tests/UNIT/eventscripts/scripts/60.nfs.sh line 413:
				if eval "$service_check_cmd"; then
                                         ^----------------^ SC2031 (info): service_check_cmd was modified in a subshell. That change might be lost.

service_check_cmd will never be set here because it is only set in a
sub-shell in rpc_set_service_failure_response().

This reverts some of commit 713ec217507d2f0d5f516efc45c8cd8773fccc14.

If testcases requiring use of service_check_cmd are later added then
this will need to be redone properly.  This would probably start by
renaming this function nfs_iterate_rpc_test().

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Martin Schwenke 2023-07-03 11:42:56 +10:00 committed by Martin Schwenke
parent cbda1a78dc
commit 1190c91090

View File

@ -358,8 +358,8 @@ program_stack_traces()
#
# - 2nd argument is the NFS/RPC service being tested
#
# rpcinfo (or $service_check_cmd) is used on each iteration to test
# the availability of the service
# rpcinfo is used on each iteration to test the availability of the
# service
#
# If this is not set or null then no RPC service is checked and the
# required output is not reset on each iteration. This is useful in
@ -402,19 +402,8 @@ EOF
shift 2
fi
if [ -n "$_rpc_service" ]; then
_ok=false
if [ -n "$service_check_cmd" ]; then
if eval "$service_check_cmd"; then
_ok=true
fi
else
if rpcinfo -T tcp localhost "$_rpc_service" \
>/dev/null 2>&1; then
_ok=true
fi
fi
if $_ok; then
if rpcinfo -T tcp localhost "$_rpc_service" \
>/dev/null 2>&1 ; then
_iterate_failcount=0
else
_iterate_failcount=$(($_iterate_failcount + 1))