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

ctdb-tests: Add some tool unit tests to ensure that timeouts work

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon Feb 10 05:34:08 UTC 2020 on sn-devel-184
This commit is contained in:
Martin Schwenke 2020-01-07 16:30:23 +11:00 committed by Amitay Isaacs
parent 0e59cd25e1
commit 0b3db29bd5
3 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,25 @@
#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "3 nodes, all ok, GET_PID control times out"
setup_lvs <<EOF
EOF
setup_ctdbd <<EOF
NODEMAP
0 192.168.20.41 0x0 CURRENT RECMASTER
1 192.168.20.42 0x0
2 192.168.20.43 0x0
CONTROLFAILS
30 0 TIMEOUT # Make "ctdb getpid" time out
EOF
#####
required_result 1 <<EOF
Maximum runtime exceeded - exiting
EOF
simple_test -T 3

View File

@ -0,0 +1,25 @@
#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "3 nodes, all ok, GET_NODEMAP control times out"
setup_lvs <<EOF
EOF
setup_ctdbd <<EOF
NODEMAP
0 192.168.20.41 0x0 CURRENT RECMASTER
1 192.168.20.42 0x0
2 192.168.20.43 0x0
CONTROLFAILS
91 0 TIMEOUT # Make "ctdb nodestatus" time out in ctdb_lvs helper
EOF
#####
required_result 1 <<EOF
Maximum runtime exceeded - exiting
EOF
simple_test status -T 3

View File

@ -0,0 +1,25 @@
#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "3 nodes, all OK, GET_NODEMAP control times out"
setup_natgw <<EOF
EOF
setup_ctdbd <<EOF
NODEMAP
0 192.168.20.41 0x0 CURRENT RECMASTER
1 192.168.20.42 0x0
2 192.168.20.43 0x0
CONTROLFAILS
91 0 TIMEOUT # Make "ctdb nodestatus" time out in ctdb_natgw helper
EOF
#####
required_result 1 <<EOF
Maximum runtime exceeded - exiting
EOF
simple_test status -T 3