ctdb-tests: Require setup_ctdbd() call in tool tests
authorMartin Schwenke <martin@meltin.net>
Thu, 7 Jul 2016 06:22:59 +0000 (16:22 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Jul 2016 19:29:43 +0000 (21:29 +0200)
This makes the ctdbd setup explicit and allows multiple calls to
simple_test() in the same test without ugly re-initialisation.

While here drop any unneeded ctdbd initialisation, such as VNNMAP and
IFACES.  These have often been needlessly present, cluttering the
tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
45 files changed:
ctdb/tests/tool/ctdb.getcapabilities.001.sh
ctdb/tests/tool/ctdb.getcapabilities.002.sh
ctdb/tests/tool/ctdb.getcapabilities.003.sh
ctdb/tests/tool/ctdb.getcapabilities.004.sh
ctdb/tests/tool/ctdb.listnodes.001.sh
ctdb/tests/tool/ctdb.listnodes.002.sh
ctdb/tests/tool/ctdb.lvs.001.sh
ctdb/tests/tool/ctdb.lvs.002.sh
ctdb/tests/tool/ctdb.lvs.003.sh
ctdb/tests/tool/ctdb.lvs.004.sh
ctdb/tests/tool/ctdb.lvs.005.sh
ctdb/tests/tool/ctdb.lvs.006.sh
ctdb/tests/tool/ctdb.lvs.007.sh
ctdb/tests/tool/ctdb.lvs.008.sh
ctdb/tests/tool/ctdb.natgw.001.sh
ctdb/tests/tool/ctdb.natgw.002.sh
ctdb/tests/tool/ctdb.natgw.003.sh
ctdb/tests/tool/ctdb.natgw.004.sh
ctdb/tests/tool/ctdb.natgw.005.sh
ctdb/tests/tool/ctdb.natgw.006.sh
ctdb/tests/tool/ctdb.natgw.007.sh
ctdb/tests/tool/ctdb.natgw.008.sh
ctdb/tests/tool/ctdb.nodestatus.001.sh
ctdb/tests/tool/ctdb.nodestatus.002.sh
ctdb/tests/tool/ctdb.recover.001.sh
ctdb/tests/tool/ctdb.reloadnodes.001.sh
ctdb/tests/tool/ctdb.reloadnodes.002.sh
ctdb/tests/tool/ctdb.reloadnodes.003.sh
ctdb/tests/tool/ctdb.reloadnodes.011.sh
ctdb/tests/tool/ctdb.reloadnodes.012.sh
ctdb/tests/tool/ctdb.reloadnodes.013.sh
ctdb/tests/tool/ctdb.reloadnodes.014.sh
ctdb/tests/tool/ctdb.reloadnodes.015.sh
ctdb/tests/tool/ctdb.reloadnodes.016.sh
ctdb/tests/tool/ctdb.reloadnodes.017.sh
ctdb/tests/tool/ctdb.reloadnodes.018.sh
ctdb/tests/tool/ctdb.reloadnodes.019.sh
ctdb/tests/tool/ctdb.reloadnodes.020.sh
ctdb/tests/tool/ctdb.reloadnodes.021.sh
ctdb/tests/tool/ctdb.reloadnodes.022.sh
ctdb/tests/tool/ctdb.reloadnodes.023.sh
ctdb/tests/tool/ctdb.reloadnodes.024.sh
ctdb/tests/tool/ctdb.status.001.sh
ctdb/tests/tool/ctdb.status.002.sh
ctdb/tests/tool/scripts/local.sh

index e924d5ad2fb68a32c898f7ce8443e3413e052497..d04db04b60df76008f4148c221aabf06070d1f38 100755 (executable)
@@ -4,25 +4,16 @@
 
 define_test "3 nodes, all ok"
 
-required_result 0 <<EOF
-RECMASTER: YES
-LMASTER: YES
-EOF
-
-simple_test <<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
+EOF
 
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
+required_result 0 <<EOF
+RECMASTER: YES
+LMASTER: YES
 EOF
+
+simple_test
index 9a5d9803355dbb70f7de5f37bcdd13b655cc7b75..f54786290e5b9304bbb3eadcc384380770489381 100755 (executable)
@@ -4,25 +4,16 @@
 
 define_test "3 nodes, 1 disconnected"
 
-required_result 0 <<EOF
-RECMASTER: YES
-LMASTER: YES
-EOF
-
-simple_test <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x1
 2       192.168.20.43   0x0
+EOF
 
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
+required_result 0 <<EOF
+RECMASTER: YES
+LMASTER: YES
 EOF
+
+simple_test
index 1de3cfde1ab96ce5e2ecc34f11f5d602a4fe1fbb..f087141454e32267a841224004894cdc62421046 100755 (executable)
@@ -4,34 +4,25 @@
 
 define_test "3 nodes, current disconnected"
 
-required_result 1 <<EOF
-../client/ctdb_client.c:293 Failed to connect client socket to daemon. Errno:No such file or directory(2)
-../common/cmdline.c:167 Failed to connect to daemon
-Failed to init ctdb
-Failed to detect which PNN this node is
-Is this node part of a CTDB cluster?
-EOF
-
 setup_nodes <<EOF
 192.168.20.41
 192.168.20.42
 192.168.20.43
 EOF
 
-simple_test <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x1     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
+EOF
 
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
+required_result 1 <<EOF
+../client/ctdb_client.c:293 Failed to connect client socket to daemon. Errno:No such file or directory(2)
+../common/cmdline.c:167 Failed to connect to daemon
+Failed to init ctdb
+Failed to detect which PNN this node is
+Is this node part of a CTDB cluster?
 EOF
+
+simple_test
index 077b34eccebb2443e6764518323b5a3512db31e1..ae4ad2b5246fc010c45b6380ba29697076b6eaea 100755 (executable)
@@ -4,48 +4,36 @@
 
 define_test "3 nodes, all ok, non-default capabilities"
 
-set -e
-
-input="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0    -CTDB_CAP_LMASTER
 2       192.168.20.43   0x0    -CTDB_CAP_RECMASTER
+EOF
 
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2"
+# node 0
 
 required_result 0 <<EOF
 RECMASTER: YES
 LMASTER: YES
 EOF
 
-simple_test -n 0 <<EOF
-$input
-EOF
+simple_test -n 0
+
+# node 1
 
 required_result 0 <<EOF
 RECMASTER: YES
 LMASTER: NO
 EOF
 
-simple_test -n 1 <<EOF
-$input
-EOF
+simple_test -n 1
+
+# node 2
 
 required_result 0 <<EOF
 RECMASTER: NO
 LMASTER: YES
 EOF
 
-simple_test -n 2 <<EOF
-$input
-EOF
+simple_test -n 2
index 618e0e7fe62d6b5622eb41d19e4b04858ff1364c..10fd9496de7a22690d4335513da2748a9b72fe87 100755 (executable)
@@ -16,5 +16,4 @@ required_result 255 <<EOF
 ${TEST_DATE_STAMP}Failed to read nodes file "${CTDB_NODES}"
 EOF
 
-simple_test <<EOF
-EOF
+simple_test
index d807e1ee268edefaeb9f9f5a05a8afb810bdea40..95315d75b64f216b70cb41668a29cb5eec078830 100755 (executable)
@@ -16,5 +16,4 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test <<EOF
-EOF
+simple_test
index 3e864625e23c519a64d40cb0d2814f8e2795e850..411072c5da4de45c23e416d20faa940bd6e05751 100755 (executable)
@@ -7,47 +7,30 @@ define_test "3 nodes, no LVS, all ok"
 setup_lvs <<EOF
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
 required_result 255 <<EOF
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
 required_result 0 <<EOF
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
 required_result 0 <<EOF
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index ed9f450aee63852624e967b315f036077cf9013b..5344b166a4e17299e66d802d5e116bb6a4d2abac 100755 (executable)
@@ -10,23 +10,12 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 0
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    OK
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 54f8f17d14cfe322708e7a8e92e716563d162d21..c3d1f7221f123fecf734a3049f4c41616861f507 100755 (executable)
@@ -9,32 +9,20 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
+EOF
 
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
 #####
 
 required_result 0 <<EOF
 0
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -43,9 +31,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -54,6 +40,4 @@ pnn:0 192.168.20.41    OK (THIS NODE)
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 8f43936bcafc4adb3f0129a83e8d10d28adb38e8..ea1d1887fe639dc1cdf4a3a41901b4bc3eff51fc 100755 (executable)
@@ -10,23 +10,12 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x2    CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 1
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -45,9 +32,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -57,6 +42,4 @@ pnn:1 192.168.20.42    OK
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 65a39d55bf72e4c31f9ae4d5cd0a9a713b9ccc65..592224863eab4091ecf2b99ae30d52e3c34ddec2 100755 (executable)
@@ -10,23 +10,12 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x2    CURRENT RECMASTER
 1       192.168.20.42   0x2
 2       192.168.20.43   0x2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 0
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    UNHEALTHY
 pnn:2 192.168.20.43    UNHEALTHY
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index f6ff2b988c923ce3af80eaf06bedc91299418ddc..2f9859a6be858cc26bd5ef8f6916db32b710e196 100755 (executable)
@@ -10,23 +10,12 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x4    CURRENT RECMASTER
 1       192.168.20.42   0x4
 2       192.168.20.43   0x2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 2
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -44,9 +31,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -56,6 +41,4 @@ pnn:1 192.168.20.42    DISABLED
 pnn:2 192.168.20.43    UNHEALTHY
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 6951283571b3cd78a737f769fe322246f48a55f5..dd47b9e69ca93e79abf218a02d3abb70bae8adf6 100755 (executable)
@@ -10,41 +10,26 @@ setup_lvs <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x4    CURRENT RECMASTER
 1       192.168.20.42   0x4
 2       192.168.20.43   0x4
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
 required_result 255 <<EOF
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
 required_result 0 <<EOF
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -54,6 +39,4 @@ pnn:1 192.168.20.42    DISABLED
 pnn:2 192.168.20.43    DISABLED
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 7323c74e9ed3e209a34aeca52a5519c144fc84ab..aedd507d85858b17bf071af754d0eb2279903eb2 100755 (executable)
@@ -13,23 +13,12 @@ EOF
 setup_lvs <<EOF
 EOF
 
-ctdb_state="\
+setup_ctdb <<EOF
 NODEMAP
 0       192.168.20.41   0x1     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -41,9 +30,7 @@ Failed to detect which PNN this node is
 Is this node part of a CTDB cluster?
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -55,9 +42,7 @@ Failed to detect which PNN this node is
 Is this node part of a CTDB cluster?
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -69,9 +54,7 @@ Failed to detect which PNN this node is
 Is this node part of a CTDB cluster?
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -83,6 +66,4 @@ Failed to detect which PNN this node is
 Is this node part of a CTDB cluster?
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 16753d24081ec9362ec2cd86e740d2c87fa1551b..b73ce24c9869cebe43d3bc0be69317983aaa2c50 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0
 2       192.168.20.43   0x0
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-
-VNNMAP
-654321
-0
-1
-2
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 0 192.168.20.41
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    OK
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index ce36c951afa8cc8531ff40f74af7f2ad0df615ff..259c8695e644c1db2c0d3632b89aab90890f6ea8 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x2
 1       192.168.20.42   0x0     CURRENT RECMASTER
 2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 1 192.168.20.42
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,7 +43,4 @@ pnn:1 192.168.20.42    OK (THIS NODE)
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
-
+simple_test status
index 7d280ac04fb9fc0d19f5cb8f8f426c4774779621..af48b48c622ecdd6f9887ec05f95470fb58ab6d6 100755 (executable)
@@ -9,23 +9,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x2
 1       192.168.20.42   0x0     CURRENT RECMASTER
 2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -33,9 +22,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -44,9 +31,7 @@ required_result 0 <<EOF
 192.168.20.43  MASTER
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -55,6 +40,4 @@ pnn:0 192.168.20.41    UNHEALTHY
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index b4190058564dc1d4245f7010ef5d90fb250593aa..8e48dcf432f0316b0d1e7bcb4e441853c14dbdaa 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x22
 1       192.168.20.42   0x22     CURRENT RECMASTER
 2       192.168.20.43   0x2
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 2 192.168.20.43
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43  MASTER
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    UNHEALTHY|STOPPED|INACTIVE (THIS NODE)
 pnn:2 192.168.20.43    UNHEALTHY
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 10fd4d471258c784d933d77fdc8a0642aa403b91..ccb05e8d8afca6cc25d502a3f59871d756e9227a 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x20
 1       192.168.20.42   0x20     CURRENT RECMASTER
 2       192.168.20.43   0x20
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 0 192.168.20.41
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    STOPPED|INACTIVE (THIS NODE)
 pnn:2 192.168.20.43    STOPPED|INACTIVE
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index e120ece4d7eb6908d92cdf2632d433eaf5400f63..0f194d81809ce870d226c87bfac08db003c1d96f 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x20
 1       192.168.20.42   0x20    CURRENT RECMASTER
 2       192.168.20.43   0x20
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 1 192.168.20.42
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    STOPPED|INACTIVE (THIS NODE)
 pnn:2 192.168.20.43    STOPPED|INACTIVE
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 9fac6bdfe83cd2a176ddef577f078c79949a8261..9fdfc302f3b3600c8abfb4b407959171e2ba3c7e 100755 (executable)
@@ -10,32 +10,19 @@ setup_natgw <<EOF
 192.168.20.43  slave-only
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x20
 1       192.168.20.42   0x20    CURRENT RECMASTER
 2       192.168.20.43   0x20
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
 required_result 2 <<EOF
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -45,9 +32,7 @@ required_result 0 <<EOF
 192.168.20.43  slave-only
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -57,6 +42,4 @@ pnn:1 192.168.20.42    STOPPED|INACTIVE (THIS NODE)
 pnn:2 192.168.20.43    STOPPED|INACTIVE
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 14e2c8479396cea1770c7cb28d3575789a528ef5..db204a51383e73285b33327faaff9512d2418edf 100755 (executable)
@@ -10,23 +10,12 @@ setup_natgw <<EOF
 192.168.20.43
 EOF
 
-ctdb_state="\
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x1
 1       192.168.20.42   0x0     CURRENT RECMASTER
 2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-
-IFACES
-:Name:LinkStatus:References:
-:eth2:1:2:
-:eth1:1:4:
-"
+EOF
 
 #####
 
@@ -34,9 +23,7 @@ required_result 0 <<EOF
 1 192.168.20.42
 EOF
 
-simple_test master <<EOF
-$ctdb_state
-EOF
+simple_test master
 
 #####
 
@@ -46,9 +33,7 @@ required_result 0 <<EOF
 192.168.20.43
 EOF
 
-simple_test list <<EOF
-$ctdb_state
-EOF
+simple_test list
 
 #####
 
@@ -58,6 +43,4 @@ pnn:1 192.168.20.42    OK (THIS NODE)
 pnn:2 192.168.20.43    OK
 EOF
 
-simple_test status <<EOF
-$ctdb_state
-EOF
+simple_test status
index 6392b8d1eccff0217198ad1edd008f07e433db02..d97892e9639dd88a2ce8235297c4fb8f70d828c0 100755 (executable)
@@ -4,14 +4,7 @@
 
 define_test "all, 3 nodes, all OK"
 
-required_result 0 <<EOF
-Number of nodes:3
-pnn:0 192.168.20.41    OK
-pnn:1 192.168.20.42    OK
-pnn:2 192.168.20.43    OK (THIS NODE)
-EOF
-
-simple_test all <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0
 1       192.168.20.42   0x0
@@ -21,10 +14,13 @@ IFACES
 :Name:LinkStatus:References:
 :eth2:1:2:
 :eth1:1:4:
+EOF
 
-VNNMAP
-654321
-0
-1
-2
+required_result 0 <<EOF
+Number of nodes:3
+pnn:0 192.168.20.41    OK
+pnn:1 192.168.20.42    OK
+pnn:2 192.168.20.43    OK (THIS NODE)
 EOF
+
+simple_test all
index a3a7a42e4344a5b310783800d42f290a42d2b98a..3f8d6935dc21d3f174e4a57494e6a63471ddfefc 100755 (executable)
@@ -4,14 +4,7 @@
 
 define_test "all, 3 nodes, 1 disconnected"
 
-required_result 1 <<EOF
-Number of nodes:3
-pnn:0 192.168.20.41    OK
-pnn:1 192.168.20.42    DISCONNECTED|INACTIVE
-pnn:2 192.168.20.43    OK (THIS NODE)
-EOF
-
-simple_test all <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0
 1       192.168.20.42   0x1
@@ -21,10 +14,13 @@ IFACES
 :Name:LinkStatus:References:
 :eth2:1:2:
 :eth1:1:4:
+EOF
 
-VNNMAP
-654321
-0
-1
-2
+required_result 1 <<EOF
+Number of nodes:3
+pnn:0 192.168.20.41    OK
+pnn:1 192.168.20.42    DISCONNECTED|INACTIVE
+pnn:2 192.168.20.43    OK (THIS NODE)
 EOF
+
+simple_test all
index d1e8f50381db1987e29cc08a9f822fe17ad5db5b..15e05ca0cb527d98b2f35aa37f9d1645d9a595f5 100755 (executable)
@@ -4,9 +4,7 @@
 
 define_test "Just a recovery"
 
-ok_null
-
-simple_test <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0      192.168.20.41   0x0     CURRENT
 1      192.168.20.42   0x0     RECMASTER
@@ -18,3 +16,7 @@ VNNMAP
 1
 2
 EOF
+
+ok_null
+
+simple_test
index 3d76b79c79709ffbf7574a853d0fae465e8b9603..24cd94af76cf63ace66a4fd36a6632360ee66ed3 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 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
+EOF
+
 ok <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -17,15 +24,4 @@ Node 2 is unchanged
 No change in nodes file, skipping unnecessary reload
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index 61b14381f2628ec3b5ef57cc166ca8901c3f8956..2e6252f1902d99f6acfb20ea5caef3fa54315ecd 100755 (executable)
@@ -16,19 +16,15 @@ setup_nodes 1 <<EOF
 192.168.20.43
 EOF
 
-required_result 255 <<EOF
-ERROR: Node file on node 1 differs from current node (0)
-EOF
-
-simple_test <<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
+EOF
 
-VNNMAP
-654321
-0
-1
-2
+required_result 255 <<EOF
+ERROR: Node file on node 1 differs from current node (0)
 EOF
+
+simple_test
index 7f3b7b2e250b0ddb670888cd54ad33007c00af70..5ba789299fa10d6de6fe8cf162a4c36a883bf2d7 100755 (executable)
@@ -18,21 +18,17 @@ EOF
 
 rm "$CTDB_NODES_1"
 
-required_result 255 <<EOF
-ctdb_control error: 'Failed to read nodes file'
-ctdb_control error: 'Failed to read nodes file'
-ERROR: Failed to get nodes file from node 1
-EOF
-
-simple_test <<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
+EOF
 
-VNNMAP
-654321
-0
-1
-2
+required_result 255 <<EOF
+ctdb_control error: 'Failed to read nodes file'
+ctdb_control error: 'Failed to read nodes file'
+ERROR: Failed to get nodes file from node 1
 EOF
+
+simple_test
index 40ff939bbedba8ffda92b8c1cbf619014d3e2468..41a5566af9146ec01254e7945f53f4af6ac5726f 100755 (executable)
@@ -11,6 +11,13 @@ setup_nodes <<EOF
 192.168.20.44
 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
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -21,15 +28,4 @@ Reloading nodes file on node 1
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index 3640ea6d4dbc896ea63bd0a3d3d5d85bb6187e82..4ebb6aed740ecf2bed4d18aa8e4933b0eccbe9c8 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 #192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x0
+2       192.168.20.43   0x1
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -18,14 +25,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 1
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x1
-
-VNNMAP
-654321
-0
-1
-EOF
+simple_test
index 877608f6f3f309dca74d9ed20c64cec0779d10ce..4156839a00bee98984d4529d5a5058bd173351ee 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 #192.168.20.43
 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
+EOF
+
 required_result 1 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -18,15 +25,4 @@ ERROR: Node 2 is still connected
 ERROR: Nodes will not be reloaded due to previous error
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index df46f0f961d7b70860bb6ba84a236f4c5dbd63eb..1a005a164bcc0a632d4aa7e7083378c694a06968 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x1
+1       192.168.20.42   0x0
+2       192.168.20.43   0x0     CURRENT RECMASTER
+EOF
+
 required_result 0 <<EOF
 Node 0 is DELETED
 Node 1 is unchanged
@@ -18,14 +25,4 @@ Reloading nodes file on node 1
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x1
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0     CURRENT RECMASTER
-
-VNNMAP
-654321
-1
-2
-EOF
+simple_test
index 1bd58fe5e6db22b876ea01cef5d86ed02a66440d..14c3c314668277a465a256c7ae2c04c5b4e96988 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0
+1       192.168.20.42   0x0
+2       192.168.20.43   0x0     CURRENT RECMASTER
+EOF
+
 required_result 1 <<EOF
 Node 0 is DELETED
 ERROR: Node 0 is still connected
@@ -18,15 +25,4 @@ Node 2 is unchanged
 ERROR: Nodes will not be reloaded due to previous error
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0     CURRENT RECMASTER
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index d79159a0f4f3f1fc38ba7ffc7e92d4ff3d2e8c88..a239a7cf1519b4bfd53099012351e9d06112c7e9 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x1
+2       192.168.20.43   0x0
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is DELETED
@@ -18,14 +25,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x1
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
-EOF
+simple_test
index 3158aede9d26299e781c0bf7075d98d151b026b8..e5f203013577b16c69359797479f3d19c1390130 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 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
+EOF
+
 required_result 1 <<EOF
 Node 0 is unchanged
 Node 1 is DELETED
@@ -18,15 +25,4 @@ Node 2 is unchanged
 ERROR: Nodes will not be reloaded due to previous error
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index 6075fcef107b400614402bcaa020ff376e4234dc..5f994d1fb3a91f585b4e166904ee28eee5e5417e 100755 (executable)
@@ -13,6 +13,13 @@ setup_nodes <<EOF
 192.168.20.46
 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
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -25,15 +32,4 @@ Reloading nodes file on node 1
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-1
-2
-EOF
+simple_test
index 7bea81af2cc0ca272238db916d0bfa369ba9d429..c40ae52fad044e312a69d847ae23a8224f30edbe 100755 (executable)
@@ -12,6 +12,13 @@ setup_nodes <<EOF
 192.168.20.45
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x1
+2       192.168.20.43   0x0
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is DELETED
@@ -22,14 +29,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x1
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
-EOF
+simple_test
index 6e7826c048c3f29bc66319f0144e13a6ad821941..da197a5ad5243b061d43e42c560f2061fefde192 100755 (executable)
@@ -12,6 +12,13 @@ setup_nodes <<EOF
 192.168.20.45
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x0
+2       192.168.20.43   0x1
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -22,14 +29,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 1
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x0
-2       192.168.20.43   0x1
-
-VNNMAP
-654321
-0
-1
-EOF
+simple_test
index aaf4e1492e3704fe779cbcce616ae544b740a559..8ec51e85b5a84b2e9da2d5c2642ecae240b6b864 100755 (executable)
@@ -11,6 +11,13 @@ setup_nodes <<EOF
 192.168.20.44
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x1
+2       192.168.20.43   0x0
+EOF
+
 required_result 0 <<EOF
 Node 0 is unchanged
 Node 1 is unchanged
@@ -21,14 +28,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x1
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
-EOF
+simple_test
index c2a89c049a69812a0c11bad17a624e1d6d7fb4a9..1b1f588b61473d1a805a4189f71c6c54e23d496d 100755 (executable)
@@ -14,16 +14,13 @@ setup_nodes <<EOF
 192.168.20.45
 EOF
 
-ok_null
-
-simple_test <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x1
 2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
 EOF
+
+ok_null
+
+simple_test
index bc768c27caecd3bee649fee225fef38cfe720519..931ba38c794c66453ca4ce48ee37fb8cdac21b90 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x11
+2       192.168.20.43   0x0
+EOF
+
 ok <<EOF
 Node 0 is unchanged
 Node 1 is UNDELETED
@@ -18,14 +25,4 @@ Reloading nodes file on node 0
 Reloading nodes file on node 2
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x11
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
-EOF
+simple_test
index 2d2d2201d3c6706f82b16dbba096c680d7d123cc..cf6cd9bbc861b9eca162385f5289ff9c12db377a 100755 (executable)
@@ -10,6 +10,13 @@ setup_nodes <<EOF
 192.168.20.43
 EOF
 
+setup_ctdbd <<EOF
+NODEMAP
+0       192.168.20.41   0x0     CURRENT RECMASTER
+1       192.168.20.42   0x11
+2       192.168.20.43   0x0
+EOF
+
 ok <<EOF
 Node 0 is unchanged
 Node 1 is unchanged (DELETED)
@@ -17,14 +24,4 @@ Node 2 is unchanged
 No change in nodes file, skipping unnecessary reload
 EOF
 
-simple_test <<EOF
-NODEMAP
-0       192.168.20.41   0x0     CURRENT RECMASTER
-1       192.168.20.42   0x11
-2       192.168.20.43   0x0
-
-VNNMAP
-654321
-0
-2
-EOF
+simple_test
index 48b5bac24a97abff8a98b4926f9fefc19fa81ef9..28f93eaa33eccc70e5507fafc624f4db9870aba1 100755 (executable)
@@ -4,21 +4,7 @@
 
 define_test "all, 3 nodes, all ok"
 
-required_result 0 <<EOF
-Number of nodes:3
-pnn:0 192.168.20.41    OK (THIS NODE)
-pnn:1 192.168.20.42    OK
-pnn:2 192.168.20.43    OK
-Generation:654321
-Size:3
-hash:0 lmaster:0
-hash:1 lmaster:1
-hash:2 lmaster:2
-Recovery mode:NORMAL (0)
-Recovery master:0
-EOF
-
-simple_test all <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x0     CURRENT RECMASTER
 1       192.168.20.42   0x0
@@ -35,3 +21,19 @@ VNNMAP
 1
 2
 EOF
+
+required_result 0 <<EOF
+Number of nodes:3
+pnn:0 192.168.20.41    OK (THIS NODE)
+pnn:1 192.168.20.42    OK
+pnn:2 192.168.20.43    OK
+Generation:654321
+Size:3
+hash:0 lmaster:0
+hash:1 lmaster:1
+hash:2 lmaster:2
+Recovery mode:NORMAL (0)
+Recovery master:0
+EOF
+
+simple_test all
index fceceb30e0d1e7f31601cf2eb315b88753a2c3d1..233847170df7c52c4c4697085d0b46e3cd077058 100755 (executable)
@@ -4,21 +4,7 @@
 
 define_test "all, 3 nodes, 1 unhealthy"
 
-required_result 0 <<EOF
-Number of nodes:3
-pnn:0 192.168.20.41    UNHEALTHY
-pnn:1 192.168.20.42    OK (THIS NODE)
-pnn:2 192.168.20.43    OK
-Generation:654321
-Size:3
-hash:0 lmaster:0
-hash:1 lmaster:1
-hash:2 lmaster:2
-Recovery mode:NORMAL (0)
-Recovery master:1
-EOF
-
-simple_test <<EOF
+setup_ctdbd <<EOF
 NODEMAP
 0       192.168.20.41   0x2
 1       192.168.20.42   0x0     CURRENT RECMASTER
@@ -35,3 +21,19 @@ IFACES
 :eth2:1:2:
 :eth1:1:4:
 EOF
+
+required_result 0 <<EOF
+Number of nodes:3
+pnn:0 192.168.20.41    UNHEALTHY
+pnn:1 192.168.20.42    OK (THIS NODE)
+pnn:2 192.168.20.43    OK
+Generation:654321
+Size:3
+hash:0 lmaster:0
+hash:1 lmaster:1
+hash:2 lmaster:2
+Recovery mode:NORMAL (0)
+Recovery master:1
+EOF
+
+simple_test
index 3033c73a68b2c4bba16535e4271ff08e8e7cb201..4118102e9fbecd81584a2fcb177d20b7b06675c9 100644 (file)
@@ -46,8 +46,8 @@ setup_ctdbd ()
 {
        debug "Setting up fake ctdbd"
 
-       cat | fake_ctdbd -s "$ctdbd_socket" -p "$ctdbd_pidfile"
-       #test_cleanup cleanup_ctdbd
+       fake_ctdbd -s "$ctdbd_socket" -p "$ctdbd_pidfile"
+       test_cleanup cleanup_ctdbd
 }
 
 setup_natgw ()
@@ -124,9 +124,7 @@ setup_nodes ()
 
 simple_test ()
 {
-    setup_ctdbd
     (unit_test $CTDB -d $CTDB_DEBUGLEVEL $test_args "$@")
     status=$?
-    cleanup_ctdbd
     [ $status -eq 0 ] || exit $status
 }