mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
tests/takeover: Add takeover tests, mostly for NoIPHostOnAllDisabled
Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 7cf63722873a6a7baafd77aa3d8a1989b221dee9)
This commit is contained in:
parent
0445c988e2
commit
b22ef16945
33
ctdb/tests/takeover/lcp2.020.sh
Executable file
33
ctdb/tests/takeover/lcp2.020.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "3 nodes, all IPs assigned, 2->3 unhealthy, NoIPHostOnAllDisabled on 2"
|
||||
|
||||
export CTDB_TEST_LOGLEVEL=0
|
||||
|
||||
required_result <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 2
|
||||
192.168.21.252 2
|
||||
192.168.20.254 2
|
||||
192.168.20.253 2
|
||||
192.168.20.252 2
|
||||
192.168.20.251 2
|
||||
192.168.20.250 2
|
||||
192.168.20.249 2
|
||||
EOF
|
||||
|
||||
export CTDB_SET_NoIPHostOnAllDisabled=1,1,0
|
||||
|
||||
simple_test 2,2,2 <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 2
|
||||
192.168.21.252 2
|
||||
192.168.20.254 2
|
||||
192.168.20.253 2
|
||||
192.168.20.252 2
|
||||
192.168.20.251 2
|
||||
192.168.20.250 2
|
||||
192.168.20.249 2
|
||||
EOF
|
33
ctdb/tests/takeover/lcp2.021.sh
Executable file
33
ctdb/tests/takeover/lcp2.021.sh
Executable file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "3 nodes, no IPs assigned, 3->2 unhealthy, NoIPHostOnAllDisabled on 2 others"
|
||||
|
||||
export CTDB_TEST_LOGLEVEL=0
|
||||
|
||||
required_result <<EOF
|
||||
192.168.21.254 0
|
||||
192.168.21.253 0
|
||||
192.168.21.252 0
|
||||
192.168.20.254 0
|
||||
192.168.20.253 0
|
||||
192.168.20.252 0
|
||||
192.168.20.251 0
|
||||
192.168.20.250 0
|
||||
192.168.20.249 0
|
||||
EOF
|
||||
|
||||
export CTDB_SET_NoIPHostOnAllDisabled=0,1,1
|
||||
|
||||
simple_test 2,2,2 <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 2
|
||||
192.168.21.252 2
|
||||
192.168.20.254 2
|
||||
192.168.20.253 2
|
||||
192.168.20.252 2
|
||||
192.168.20.251 2
|
||||
192.168.20.250 2
|
||||
192.168.20.249 2
|
||||
EOF
|
35
ctdb/tests/takeover/lcp2.022.sh
Executable file
35
ctdb/tests/takeover/lcp2.022.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "3 nodes, no IPs assigned, 3->2 unhealthy, NoIPTakeover on 2 others"
|
||||
|
||||
export CTDB_TEST_LOGLEVEL=0
|
||||
|
||||
# We expect 1/2 the IPs to move, but the rest to stay (as opposed to
|
||||
# NoIPHostOnAllDisabled)
|
||||
required_result <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 0
|
||||
192.168.21.252 2
|
||||
192.168.20.254 0
|
||||
192.168.20.253 0
|
||||
192.168.20.252 2
|
||||
192.168.20.251 0
|
||||
192.168.20.250 2
|
||||
192.168.20.249 2
|
||||
EOF
|
||||
|
||||
export CTDB_SET_NoIPTakeover=0,1,1
|
||||
|
||||
simple_test 2,2,2 <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 2
|
||||
192.168.21.252 2
|
||||
192.168.20.254 2
|
||||
192.168.20.253 2
|
||||
192.168.20.252 2
|
||||
192.168.20.251 2
|
||||
192.168.20.250 2
|
||||
192.168.20.249 2
|
||||
EOF
|
77
ctdb/tests/takeover/lcp2.023.sh
Executable file
77
ctdb/tests/takeover/lcp2.023.sh
Executable file
@ -0,0 +1,77 @@
|
||||
#!/bin/sh
|
||||
|
||||
. "${TEST_SCRIPTS_DIR}/unit.sh"
|
||||
|
||||
define_test "3 nodes, all IPs assigned, 1->3 unhealthy"
|
||||
|
||||
export CTDB_TEST_LOGLEVEL=4
|
||||
|
||||
required_result <<EOF
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES (UNASSIGNED)
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 2 [147968]
|
||||
DATE TIME [PID]: 2 [-58359] -> 192.168.21.254 -> 1 [+0]
|
||||
DATE TIME [PID]: 2 [-58359] -> 192.168.21.252 -> 1 [+0]
|
||||
DATE TIME [PID]: 2 [-59572] -> 192.168.20.253 -> 1 [+0]
|
||||
DATE TIME [PID]: 2 [-59823] -> 192.168.20.251 -> 1 [+0]
|
||||
DATE TIME [PID]: 2 [-59823] -> 192.168.20.249 -> 1 [+0]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: 2 [-59823] -> 192.168.20.251 -> 1 [+0]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 0 [89609]
|
||||
DATE TIME [PID]: 0 [-42483] -> 192.168.21.253 -> 1 [+14161]
|
||||
DATE TIME [PID]: 0 [-45662] -> 192.168.20.254 -> 1 [+15625]
|
||||
DATE TIME [PID]: 0 [-45662] -> 192.168.20.252 -> 1 [+15625]
|
||||
DATE TIME [PID]: 0 [-45411] -> 192.168.20.250 -> 1 [+16129]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: 0 [-45662] -> 192.168.20.254 -> 1 [+15625]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 2 [88145]
|
||||
DATE TIME [PID]: 2 [-44198] -> 192.168.21.254 -> 1 [+28322]
|
||||
DATE TIME [PID]: 2 [-44198] -> 192.168.21.252 -> 1 [+28322]
|
||||
DATE TIME [PID]: 2 [-43947] -> 192.168.20.253 -> 1 [+31501]
|
||||
DATE TIME [PID]: 2 [-43947] -> 192.168.20.249 -> 1 [+31501]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: 2 [-44198] -> 192.168.21.254 -> 1 [+28322]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 0 [44198]
|
||||
DATE TIME [PID]: 0 [-28322] -> 192.168.21.253 -> 1 [+44198]
|
||||
DATE TIME [PID]: 0 [-29786] -> 192.168.20.252 -> 1 [+45662]
|
||||
DATE TIME [PID]: 0 [-29786] -> 192.168.20.250 -> 1 [+45915]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 2 [44198]
|
||||
DATE TIME [PID]: 2 [-28322] -> 192.168.21.252 -> 1 [+44198]
|
||||
DATE TIME [PID]: 2 [-29786] -> 192.168.20.253 -> 1 [+45662]
|
||||
DATE TIME [PID]: 2 [-29786] -> 192.168.20.249 -> 1 [+45662]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
DATE TIME [PID]: CONSIDERING MOVES FROM 1 [43947]
|
||||
DATE TIME [PID]: 1 [-28322] -> 192.168.21.254 -> 1 [+28322]
|
||||
DATE TIME [PID]: 1 [-29786] -> 192.168.20.254 -> 1 [+29786]
|
||||
DATE TIME [PID]: 1 [-29786] -> 192.168.20.251 -> 1 [+29786]
|
||||
DATE TIME [PID]: ----------------------------------------
|
||||
192.168.21.254 1
|
||||
192.168.21.253 0
|
||||
192.168.21.252 2
|
||||
192.168.20.254 1
|
||||
192.168.20.253 2
|
||||
192.168.20.252 0
|
||||
192.168.20.251 1
|
||||
192.168.20.250 0
|
||||
192.168.20.249 2
|
||||
EOF
|
||||
|
||||
simple_test 2,2,2 <<EOF
|
||||
192.168.21.254 2
|
||||
192.168.21.253 0
|
||||
192.168.21.252 2
|
||||
192.168.20.254 0
|
||||
192.168.20.253 2
|
||||
192.168.20.252 0
|
||||
192.168.20.251 2
|
||||
192.168.20.250 0
|
||||
192.168.20.249 2
|
||||
EOF
|
Loading…
Reference in New Issue
Block a user