ctdb-scripts: Only consider statistics on timeout
commit032b7b49c9f50fa8e4e049d066e5f1ddb6295d89
authorMartin Schwenke <mschwenke@ddn.com>
Sun, 30 Jun 2024 00:35:09 +0000 (30 10:35 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 20 Aug 2024 22:50:34 +0000 (20 22:50 +0000)
tree77e44590074c4d78532181096b3fb4b7adc7d029
parentf7a96deafa9f94522b0532357a388042c514ac7c
ctdb-scripts: Only consider statistics on timeout

Checking statistics is only really relevant to timeouts.  That is, if
an rpcinfo times out it is worth checking if the service making
progress.  If the RPC service is not registered then the statistics
don't need to be checked because they shouldn't be changing.

The 2 previously added tests added to check statistics progress now
behave identically and fail on all iterations.  To support testing
with "timeouts", an optional TIMEOUT flag can now be added to the RPC
service passed to nfs_iterate_test().  2 new tests are added to
exercise the new behaviour.

The 2 new "if" statements in nfs_iterate_test() could be combined.
However, a subsequent commit would split them and would be more
difficult to read.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/events/legacy/60.nfs.script
ctdb/tests/UNIT/eventscripts/60.nfs.monitor.117.sh [new file with mode: 0755]
ctdb/tests/UNIT/eventscripts/60.nfs.monitor.118.sh [new file with mode: 0755]
ctdb/tests/UNIT/eventscripts/scripts/60.nfs.sh
ctdb/tests/UNIT/eventscripts/stubs/rpcinfo