1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

ctdb-scripts: NFS RPC checks should be simple and consistent

Change status, nlockmgr, mountd, rquotad to be unhealthy after 6
rpcinfo check failures and do a verbose restart after every 2
failures.  Change 60.ganesha for consistency, since 60.ganesha tests
are broken and depend on the consistency.

Apart from the consistency aspect, the check infrastructure will soon
be simplified so that it only allows the equivalent of "unhealthy" and
"verbose restart:b" actions.

Update tests to have a corresponding numbers of iterations.  Run 1
extra iteration in most tests to check there are no unexpected
behaviour changes after the designated number of iterations completes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2015-06-17 19:35:21 +10:00 committed by Amitay Isaacs
parent a04ccedd24
commit 6f3ee81d17
15 changed files with 38 additions and 42 deletions

View File

@ -230,19 +230,17 @@ case "$1" in
p="rpc.statd"
type $p >/dev/null 2>/dev/null && \
nfs_check_rpc_service "statd" \
% 10 "verbose restart:b unhealthy" \
-ge 6 "verbose unhealthy" \
-eq 4 "verbose restart" \
-eq 2 "restart:b"
-ge 6 "verbose restart:b unhealthy" \
% 2 "verbose restart:b"
if [ "$CTDB_SKIP_GANESHA_NFSD_CHECK" != "yes" ] ; then
monitor_ganesha_nfsd
fi
# rquotad is sometimes not started correctly on RHEL5
# not a critical service so we dont flag the node as unhealthy
nfs_check_rpc_service "rquotad" \
-gt 0 "verbose restart:b"
-ge 6 "verbose restart:b unhealthy" \
% 2 "verbose restart:b"
;;
*)

View File

@ -1,4 +1,2 @@
% 10 verbose restart:b unhealthy
-ge 6 verbose unhealthy
-eq 4 verbose restart
-eq 2 restart:b
-ge 6 verbose restart:b unhealthy
% 2 verbose restart:b

View File

@ -1,2 +1,2 @@
-ge 15 verbose restart:b unhealthy
-eq 10 restart:b
-ge 6 verbose restart:b unhealthy
% 2 verbose restart:b

View File

@ -1,2 +1,2 @@
-ge 10 verbose restart:b unhealthy
-eq 5 restart:b
-ge 6 verbose restart:b unhealthy
% 2 verbose restart:b

View File

@ -1 +1,2 @@
-gt 0 verbose restart:b
-ge 6 verbose restart:b unhealthy
% 2 verbose restart:b

View File

@ -2,10 +2,9 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "rquotad down"
define_test "rquotad down, 2 iterations"
setup_nfs_ganesha
rpc_services_down "rquotad"
rpc_set_service_failure_response "rquotad"
simple_test
nfs_iterate_test 2 "rquotad"

View File

@ -2,7 +2,7 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "lockd down, 15 iterations"
define_test "lockd down, 7 iterations"
# This simulates an ongoing failure in the eventscript's automated
# attempts to restart the service. That is, the eventscript is unable
@ -11,4 +11,4 @@ define_test "lockd down, 15 iterations"
setup_nfs
rpc_services_down "nlockmgr"
nfs_iterate_test 15 "nlockmgr"
nfs_iterate_test 7 "nlockmgr"

View File

@ -2,7 +2,7 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "lockd down, 15 iterations, back up after 10"
define_test "lockd down, 7 iterations, back up after 2"
# This simulates a success the eventscript's automated attempts to
# restart the service.
@ -10,8 +10,8 @@ define_test "lockd down, 15 iterations, back up after 10"
setup_nfs
rpc_services_down "nlockmgr"
# Iteration 10 should try to restart rpc.lockd. However, our test
# 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 15 "nlockmgr" \
11 "rpc_services_up nlockmgr"
nfs_iterate_test 7 "nlockmgr" \
3 "rpc_services_up nlockmgr"

View File

@ -2,9 +2,9 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "rquotad down, 5 iterations"
define_test "rquotad down, 7 iterations"
setup_nfs
rpc_services_down "rquotad"
nfs_iterate_test 5 "rquotad"
nfs_iterate_test 7 "rquotad"

View File

@ -2,13 +2,13 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "rquotad down, 5 iterations, back up after 1"
define_test "rquotad down, 7 iterations, back up after 2"
# rquotad fails once but then comes back of its own accord after 1
# rquotad fails once but then comes back after restart after 2nd
# failure.
setup_nfs
rpc_services_down "rquotad"
nfs_iterate_test 5 "rquotad" \
2 'rpc_services_up "rquotad"'
nfs_iterate_test 7 "rquotad" \
3 'rpc_services_up "rquotad"'

View File

@ -2,11 +2,11 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "statd down, 6 iterations"
define_test "statd down, 7 iterations"
# statd fails and attempts to restart it fail.
setup_nfs
rpc_services_down "status"
nfs_iterate_test 6 "status"
nfs_iterate_test 7 "status"

View File

@ -2,12 +2,12 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "statd down, 8 iterations, back up after 2"
define_test "statd down, 7 iterations, back up after 2"
# statd fails and the first attempt to restart it succeeds.
setup_nfs
rpc_services_down "status"
nfs_iterate_test 8 "status" \
nfs_iterate_test 7 "status" \
3 'rpc_services_up "status"'

View File

@ -2,11 +2,11 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "statd down, 10 iterations"
define_test "statd down, 7 iterations"
# statd fails and attempts to restart it fail.
setup_nfs
rpc_services_down "status"
nfs_iterate_test 10 "status"
nfs_iterate_test 7 "status"

View File

@ -2,7 +2,7 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "mountd down, 10 iterations"
define_test "mountd down, 7 iterations"
# This simulates an ongoing failure in the eventscript's automated
# attempts to restart the service. That is, the eventscript is unable
@ -11,4 +11,4 @@ define_test "mountd down, 10 iterations"
setup_nfs
rpc_services_down "mountd"
nfs_iterate_test 10 "mountd"
nfs_iterate_test 7 "mountd"

View File

@ -2,13 +2,13 @@
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "mountd down, 10 iterations, back up after 5"
define_test "mountd down, 7 iterations, back up after 2"
setup_nfs
rpc_services_down "mountd"
# Iteration 5 should try to restart rpc.mountd. However, our test
# 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 10 "mountd" \
6 "rpc_services_up mountd"
nfs_iterate_test 7 "mountd" \
3 "rpc_services_up mountd"