summaryrefslogtreecommitdiff
path: root/ctdb/tests
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-04-18 14:47:23 +1000
committerAmitay Isaacs <amitay@samba.org>2016-04-25 07:10:15 +0200
commitcc3e9a651df80fe40d29f8b5f70d72a45beccc6f (patch)
treef4a48aeea5e2f306cc54ea508feb8739021074fb /ctdb/tests
parent515e2a2d877b66d7fb3bdf86b3e03cefd16da9f6 (diff)
downloadsamba-cc3e9a651df80fe40d29f8b5f70d72a45beccc6f.tar.gz
ctdb-tests: Make ctdb natgw tool tests cover all the desired outputs
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tests')
-rwxr-xr-xctdb/tests/tool/stubby.natgw.001.sh (renamed from ctdb/tests/tool/stubby.natgwlist.001.sh)44
-rwxr-xr-xctdb/tests/tool/stubby.natgw.002.sh (renamed from ctdb/tests/tool/stubby.natgwlist.002.sh)45
-rwxr-xr-xctdb/tests/tool/stubby.natgw.003.sh (renamed from ctdb/tests/tool/stubby.natgwlist.003.sh)41
-rwxr-xr-xctdb/tests/tool/stubby.natgw.004.sh (renamed from ctdb/tests/tool/stubby.natgwlist.004.sh)44
-rwxr-xr-xctdb/tests/tool/stubby.natgw.005.sh (renamed from ctdb/tests/tool/stubby.natgwlist.005.sh)44
-rwxr-xr-xctdb/tests/tool/stubby.natgw.006.sh (renamed from ctdb/tests/tool/stubby.natgwlist.006.sh)44
-rwxr-xr-xctdb/tests/tool/stubby.natgw.007.sh (renamed from ctdb/tests/tool/stubby.natgwlist.007.sh)43
-rwxr-xr-xctdb/tests/tool/stubby.natgw.008.sh (renamed from ctdb/tests/tool/stubby.natgwlist.008.sh)44
8 files changed, 278 insertions, 71 deletions
diff --git a/ctdb/tests/tool/stubby.natgwlist.001.sh b/ctdb/tests/tool/stubby.natgw.001.sh
index f1d2d37f834..16753d24081 100755
--- a/ctdb/tests/tool/stubby.natgwlist.001.sh
+++ b/ctdb/tests/tool/stubby.natgw.001.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-0 192.168.20.41
-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
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x0 CURRENT RECMASTER
1 192.168.20.42 0x0
@@ -34,4 +26,38 @@ VNNMAP
0
1
2
+"
+
+#####
+
+required_result 0 <<EOF
+0 192.168.20.41
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41 MASTER
+192.168.20.42
+192.168.20.43
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 OK (THIS NODE)
+pnn:1 192.168.20.42 OK
+pnn:2 192.168.20.43 OK
+EOF
+
+simple_test status <<EOF
+$ctdb_state
EOF
diff --git a/ctdb/tests/tool/stubby.natgwlist.002.sh b/ctdb/tests/tool/stubby.natgw.002.sh
index 37f172298ca..ce36c951afa 100755
--- a/ctdb/tests/tool/stubby.natgwlist.002.sh
+++ b/ctdb/tests/tool/stubby.natgw.002.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-1 192.168.20.42
-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
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x2
1 192.168.20.42 0x0 CURRENT RECMASTER
@@ -34,4 +26,39 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+1 192.168.20.42
+EOF
+
+simple_test master <<EOF
+$ctdb_state
EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41
+192.168.20.42 MASTER
+192.168.20.43
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 UNHEALTHY
+pnn:1 192.168.20.42 OK (THIS NODE)
+pnn:2 192.168.20.43 OK
+EOF
+
+simple_test status <<EOF
+$ctdb_state
+EOF
+
diff --git a/ctdb/tests/tool/stubby.natgwlist.003.sh b/ctdb/tests/tool/stubby.natgw.003.sh
index 19b1797e255..7d280ac04fb 100755
--- a/ctdb/tests/tool/stubby.natgwlist.003.sh
+++ b/ctdb/tests/tool/stubby.natgw.003.sh
@@ -9,14 +9,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-2 192.168.20.43
-Number of nodes:2
-pnn:0 192.168.20.41 UNHEALTHY
-pnn:2 192.168.20.43 OK
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x2
1 192.168.20.42 0x0 CURRENT RECMASTER
@@ -32,4 +25,36 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+2 192.168.20.43
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41
+192.168.20.43 MASTER
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 UNHEALTHY
+pnn:2 192.168.20.43 OK
+EOF
+
+simple_test status <<EOF
+$ctdb_state
EOF
diff --git a/ctdb/tests/tool/stubby.natgwlist.004.sh b/ctdb/tests/tool/stubby.natgw.004.sh
index 2abec5e18a1..b4190058564 100755
--- a/ctdb/tests/tool/stubby.natgwlist.004.sh
+++ b/ctdb/tests/tool/stubby.natgw.004.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-2 192.168.20.43
-Number of nodes:3
-pnn:0 192.168.20.41 UNHEALTHY|STOPPED|INACTIVE
-pnn:1 192.168.20.42 UNHEALTHY|STOPPED|INACTIVE (THIS NODE)
-pnn:2 192.168.20.43 UNHEALTHY
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x22
1 192.168.20.42 0x22 CURRENT RECMASTER
@@ -34,4 +26,38 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+2 192.168.20.43
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41
+192.168.20.42
+192.168.20.43 MASTER
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 UNHEALTHY|STOPPED|INACTIVE
+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
diff --git a/ctdb/tests/tool/stubby.natgwlist.005.sh b/ctdb/tests/tool/stubby.natgw.005.sh
index 42c7dbbab58..10fd4d47125 100755
--- a/ctdb/tests/tool/stubby.natgwlist.005.sh
+++ b/ctdb/tests/tool/stubby.natgw.005.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-0 192.168.20.41
-Number of nodes:3
-pnn:0 192.168.20.41 STOPPED|INACTIVE
-pnn:1 192.168.20.42 STOPPED|INACTIVE (THIS NODE)
-pnn:2 192.168.20.43 STOPPED|INACTIVE
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x20
1 192.168.20.42 0x20 CURRENT RECMASTER
@@ -34,4 +26,38 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+0 192.168.20.41
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41 MASTER
+192.168.20.42
+192.168.20.43
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 STOPPED|INACTIVE
+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
diff --git a/ctdb/tests/tool/stubby.natgwlist.006.sh b/ctdb/tests/tool/stubby.natgw.006.sh
index 6de8e121a53..e120ece4d7e 100755
--- a/ctdb/tests/tool/stubby.natgwlist.006.sh
+++ b/ctdb/tests/tool/stubby.natgw.006.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-1 192.168.20.42
-Number of nodes:3
-pnn:0 192.168.20.41 STOPPED|INACTIVE
-pnn:1 192.168.20.42 STOPPED|INACTIVE (THIS NODE)
-pnn:2 192.168.20.43 STOPPED|INACTIVE
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x20
1 192.168.20.42 0x20 CURRENT RECMASTER
@@ -34,4 +26,38 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+1 192.168.20.42
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41 slave-only
+192.168.20.42 MASTER
+192.168.20.43
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 STOPPED|INACTIVE
+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
diff --git a/ctdb/tests/tool/stubby.natgwlist.007.sh b/ctdb/tests/tool/stubby.natgw.007.sh
index 563d86737fc..9fac6bdfe83 100755
--- a/ctdb/tests/tool/stubby.natgwlist.007.sh
+++ b/ctdb/tests/tool/stubby.natgw.007.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43 slave-only
EOF
-required_result 2 <<EOF
--1 0.0.0.0
-Number of nodes:3
-pnn:0 192.168.20.41 STOPPED|INACTIVE
-pnn:1 192.168.20.42 STOPPED|INACTIVE (THIS NODE)
-pnn:2 192.168.20.43 STOPPED|INACTIVE
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x20
1 192.168.20.42 0x20 CURRENT RECMASTER
@@ -34,4 +26,37 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 2 <<EOF
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41 slave-only
+192.168.20.42 slave-only
+192.168.20.43 slave-only
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 STOPPED|INACTIVE
+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
diff --git a/ctdb/tests/tool/stubby.natgwlist.008.sh b/ctdb/tests/tool/stubby.natgw.008.sh
index e213400ff9a..14e2c847939 100755
--- a/ctdb/tests/tool/stubby.natgwlist.008.sh
+++ b/ctdb/tests/tool/stubby.natgw.008.sh
@@ -10,15 +10,7 @@ setup_natgw <<EOF
192.168.20.43
EOF
-required_result 0 <<EOF
-1 192.168.20.42
-Number of nodes:3
-pnn:0 192.168.20.41 DISCONNECTED|INACTIVE
-pnn:1 192.168.20.42 OK (THIS NODE)
-pnn:2 192.168.20.43 OK
-EOF
-
-simple_test <<EOF
+ctdb_state="\
NODEMAP
0 192.168.20.41 0x1
1 192.168.20.42 0x0 CURRENT RECMASTER
@@ -34,4 +26,38 @@ IFACES
:Name:LinkStatus:References:
:eth2:1:2:
:eth1:1:4:
+"
+
+#####
+
+required_result 0 <<EOF
+1 192.168.20.42
+EOF
+
+simple_test master <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+192.168.20.41
+192.168.20.42 MASTER
+192.168.20.43
+EOF
+
+simple_test list <<EOF
+$ctdb_state
+EOF
+
+#####
+
+required_result 0 <<EOF
+pnn:0 192.168.20.41 DISCONNECTED|INACTIVE
+pnn:1 192.168.20.42 OK (THIS NODE)
+pnn:2 192.168.20.43 OK
+EOF
+
+simple_test status <<EOF
+$ctdb_state
EOF