diff options
author | Martin Schwenke <martin@meltin.net> | 2013-07-04 20:02:29 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-07-05 15:52:34 +1000 |
commit | f92e49f6f8ea2c3178f0c90d621aa81425aabc74 (patch) | |
tree | a475cd9c69d90837d5fc6aaf2f783e225872bb2f | |
parent | d6d1fb1f46604a065bf8600e20a352bb9e0cf2e5 (diff) | |
download | samba-f92e49f6f8ea2c3178f0c90d621aa81425aabc74.tar.gz |
tests/eventscripts: Add some rudimentary tests for 60.ganesha
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit e1cf1f728236d808bb41265e74bc65f54bf1c133)
-rwxr-xr-x | ctdb/tests/eventscripts/60.ganesha.monitor.101.sh | 11 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.ganesha.monitor.131.sh | 17 | ||||
-rwxr-xr-x | ctdb/tests/eventscripts/60.ganesha.monitor.141.sh | 39 | ||||
-rw-r--r-- | ctdb/tests/eventscripts/scripts/local.sh | 14 |
4 files changed, 81 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/60.ganesha.monitor.101.sh b/ctdb/tests/eventscripts/60.ganesha.monitor.101.sh new file mode 100755 index 00000000000..d68ad6a4a2f --- /dev/null +++ b/ctdb/tests/eventscripts/60.ganesha.monitor.101.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "all services available" + +setup_nfs_ganesha + +ok_null + +simple_test diff --git a/ctdb/tests/eventscripts/60.ganesha.monitor.131.sh b/ctdb/tests/eventscripts/60.ganesha.monitor.131.sh new file mode 100755 index 00000000000..95ce450e79f --- /dev/null +++ b/ctdb/tests/eventscripts/60.ganesha.monitor.131.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "rquotad down" + +setup_nfs_ganesha +rpc_services_down "rquotad" + +ok<<EOF +ERROR: rquotad failed RPC check: +rpcinfo: RPC: Program not registered +program rquotad version 1 is not available +Trying to restart rquotad [rpc.rquotad] +EOF + +simple_test diff --git a/ctdb/tests/eventscripts/60.ganesha.monitor.141.sh b/ctdb/tests/eventscripts/60.ganesha.monitor.141.sh new file mode 100755 index 00000000000..656a5307289 --- /dev/null +++ b/ctdb/tests/eventscripts/60.ganesha.monitor.141.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "statd down, 6 iterations" + +# statd fails and attempts to restart it fail. + +setup_nfs_ganesha +rpc_services_down "status" + +ok_null +simple_test || exit $? + +ok<<EOF +Trying to restart statd [rpc.statd -n cluster1 -H /etc/ctdb/statd-callout ] +EOF +simple_test || exit $? + +ok_null +simple_test || exit $? + +ok<<EOF +ERROR: status failed RPC check: +rpcinfo: RPC: Program not registered +program status version 1 is not available +Trying to restart statd [rpc.statd -n cluster1 -H /etc/ctdb/statd-callout ] +EOF +simple_test || exit $? + +ok_null +simple_test || exit $? + +required_result 1 <<EOF +ERROR: status failed RPC check: +rpcinfo: RPC: Program not registered +program status version 1 is not available +EOF +simple_test || exit $? diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index 20988ae4ec6..6d1d52763a3 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -591,6 +591,20 @@ setup_nfs () fi } +setup_nfs_ganesha () +{ + setup_nfs "$@" + export NFS_SERVER_MODE="ganesha" + if [ "$1" != "down" ] ; then + export CTDB_MANAGES_NFS="yes" + fi + + # We do not support testing the Ganesha-nfsd-specific part of the + # eventscript. + export CTDB_SKIP_GANESHA_NFSD_CHECK="yes" + export CTDB_NFS_SKIP_SHARE_CHECK="yes" +} + rpc_services_down () { for _i ; do |