From: Martin Schwenke Date: Thu, 4 Jul 2024 00:44:18 +0000 (+1000) Subject: ctdb-tests: Argument 3 to nfs_iterate_test() is up iteration X-Git-Tag: tdb-1.4.13~1339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d9661d587f9c2d8241f4f6f5fb58394ecd658e0;p=thirdparty%2Fsamba.git ctdb-tests: Argument 3 to nfs_iterate_test() is up iteration Nothing more complex is ever done, so we might as well simplify and reduce coupling. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.122.sh b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.122.sh index 783bafe89b5..9999b2b4b28 100755 --- a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.122.sh +++ b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.122.sh @@ -12,5 +12,4 @@ setup # Iteration 2 should try to restart rpc.lockd. However, our test # stub rpc.lockd does nothing, so we have to explicitly flag it as up. -nfs_iterate_test 7 "nlockmgr" \ - 3 "rpc_services_up nlockmgr" +nfs_iterate_test 7 "nlockmgr" 3 diff --git a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.132.sh b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.132.sh index 97af413f631..648469390a1 100755 --- a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.132.sh +++ b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.132.sh @@ -9,5 +9,4 @@ define_test "rquotad down, 7 iterations, back up after 2" setup -nfs_iterate_test 7 "rquotad" \ - 3 'rpc_services_up "rquotad"' +nfs_iterate_test 7 "rquotad" 3 diff --git a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.142.sh b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.142.sh index 266c52fe73c..d0ed6b527e3 100755 --- a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.142.sh +++ b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.142.sh @@ -8,5 +8,4 @@ define_test "statd down, 7 iterations, back up after 2" setup -nfs_iterate_test 7 "status" \ - 3 'rpc_services_up "status"' +nfs_iterate_test 7 "status" 3 diff --git a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.153.sh b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.153.sh index f105976702e..c840bbe4b60 100755 --- a/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.153.sh +++ b/ctdb/tests/UNIT/eventscripts/60.nfs.monitor.153.sh @@ -9,5 +9,4 @@ setup # Iteration 2 should try to restart rpc.mountd. However, our test # stub rpc.mountd does nothing, so we have to explicitly flag it as # up. -nfs_iterate_test 7 "mountd" \ - 3 "rpc_services_up mountd" +nfs_iterate_test 7 "mountd" 3 diff --git a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh index a09f4b6a148..d5e752a99f1 100644 --- a/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh +++ b/ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh @@ -397,19 +397,14 @@ program_stack_traces() # useful in baseline tests to confirm that the eventscript and test # infrastructure is working correctly. # -# - Subsequent arguments come in pairs: an iteration number and -# something to eval before that iteration. Each time an iteration -# number is matched the associated argument is given to eval after -# the default setup is done. The iteration numbers need to be given -# in ascending order. -# -# These arguments can allow a service to be started or stopped -# before a particular iteration. +# - 3rd argument is optional iteration on which to bring the RPC +# service back up # nfs_iterate_test() { _repeats="$1" _rpc_service="$2" + _up_iteration="${3:--1}" if [ -n "$2" ]; then shift 2 else @@ -432,19 +427,14 @@ EOF _iterate_failcount=0 for _iteration in $(seq 1 "$_repeats"); do - # This is not a numerical comparison because $1 will - # often not be set. - if [ "$_iteration" = "$1" ]; then - debug </dev/null 2>&1; then _iterate_failcount=0