diff options
-rwxr-xr-x | ctdb/tests/tool/stubby.getcapabilities.001.sh | 30 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.getcapabilities.002.sh | 30 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.getcapabilities.003.sh | 27 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.lvs.001.sh | 27 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.lvsmaster.001.sh | 28 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.lvsmaster.002.sh | 28 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.natgwlist.001.sh | 37 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.natgwlist.002.sh | 37 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.natgwlist.003.sh | 35 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.natgwlist.004.sh | 37 | ||||
-rwxr-xr-x | ctdb/tests/tool/stubby.natgwlist.005.sh | 37 |
11 files changed, 353 insertions, 0 deletions
diff --git a/ctdb/tests/tool/stubby.getcapabilities.001.sh b/ctdb/tests/tool/stubby.getcapabilities.001.sh new file mode 100755 index 0000000000..df4a659008 --- /dev/null +++ b/ctdb/tests/tool/stubby.getcapabilities.001.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all ok" + +required_result 0 <<EOF +RECMASTER: YES +LMASTER: YES +LVS: NO +NATGW: YES +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 + +IFACES +:Name:LinkStatus:References: +:eth2:1:2: +:eth1:1:4: + +VNNMAP +654321 +0 +1 +2 +EOF diff --git a/ctdb/tests/tool/stubby.getcapabilities.002.sh b/ctdb/tests/tool/stubby.getcapabilities.002.sh new file mode 100755 index 0000000000..9a37c4a93e --- /dev/null +++ b/ctdb/tests/tool/stubby.getcapabilities.002.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, 1 disconnected" + +required_result 0 <<EOF +RECMASTER: YES +LMASTER: YES +LVS: NO +NATGW: YES +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 + +IFACES +:Name:LinkStatus:References: +:eth2:1:2: +:eth1:1:4: + +VNNMAP +654321 +0 +1 +2 +EOF diff --git a/ctdb/tests/tool/stubby.getcapabilities.003.sh b/ctdb/tests/tool/stubby.getcapabilities.003.sh new file mode 100755 index 0000000000..33b1b74a20 --- /dev/null +++ b/ctdb/tests/tool/stubby.getcapabilities.003.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, current disconnected" + +required_result 10 <<EOF +DATE TIME [PID]: Unable to get nodemap from local node +EOF + +simple_test <<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 diff --git a/ctdb/tests/tool/stubby.lvs.001.sh b/ctdb/tests/tool/stubby.lvs.001.sh new file mode 100755 index 0000000000..29e9ce0cdc --- /dev/null +++ b/ctdb/tests/tool/stubby.lvs.001.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all ok" + +# This isn't very useful, since the stub for capabilities does set LVS :-) +required_result 0 <<EOF +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 + +IFACES +:Name:LinkStatus:References: +:eth2:1:2: +:eth1:1:4: + +VNNMAP +654321 +0 +1 +2 +EOF diff --git a/ctdb/tests/tool/stubby.lvsmaster.001.sh b/ctdb/tests/tool/stubby.lvsmaster.001.sh new file mode 100755 index 0000000000..cc4c42d801 --- /dev/null +++ b/ctdb/tests/tool/stubby.lvsmaster.001.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all ok" + +# This isn't very useful, since the stub for capabilities does set LVS :-) +required_result 255 <<EOF +There is no LVS master +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 + +IFACES +:Name:LinkStatus:References: +:eth2:1:2: +:eth1:1:4: + +VNNMAP +654321 +0 +1 +2 +EOF diff --git a/ctdb/tests/tool/stubby.lvsmaster.002.sh b/ctdb/tests/tool/stubby.lvsmaster.002.sh new file mode 100755 index 0000000000..b45f0cd9f5 --- /dev/null +++ b/ctdb/tests/tool/stubby.lvsmaster.002.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, current disconnected" + +# This isn't very useful, since the stub for capabilities does set LVS :-) +required_result 10 <<EOF +DATE TIME [PID]: Unable to get nodemap from local node +EOF + +simple_test -Y <<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 diff --git a/ctdb/tests/tool/stubby.natgwlist.001.sh b/ctdb/tests/tool/stubby.natgwlist.001.sh new file mode 100755 index 0000000000..f1d2d37f83 --- /dev/null +++ b/ctdb/tests/tool/stubby.natgwlist.001.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all in natgw group, all ok" + +setup_natgw <<EOF +192.168.20.41 +192.168.20.42 +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 +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 diff --git a/ctdb/tests/tool/stubby.natgwlist.002.sh b/ctdb/tests/tool/stubby.natgwlist.002.sh new file mode 100755 index 0000000000..37f172298c --- /dev/null +++ b/ctdb/tests/tool/stubby.natgwlist.002.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all in natgw group, 1 unhealthy" + +setup_natgw <<EOF +192.168.20.41 +192.168.20.42 +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 +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 diff --git a/ctdb/tests/tool/stubby.natgwlist.003.sh b/ctdb/tests/tool/stubby.natgwlist.003.sh new file mode 100755 index 0000000000..19b1797e25 --- /dev/null +++ b/ctdb/tests/tool/stubby.natgwlist.003.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, 2 in natgw group, 1 unhealthy" + +setup_natgw <<EOF +192.168.20.41 +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 +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 diff --git a/ctdb/tests/tool/stubby.natgwlist.004.sh b/ctdb/tests/tool/stubby.natgwlist.004.sh new file mode 100755 index 0000000000..2abec5e18a --- /dev/null +++ b/ctdb/tests/tool/stubby.natgwlist.004.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all unhealthy, all but 1 stopped" + +setup_natgw <<EOF +192.168.20.41 +192.168.20.42 +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 +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 diff --git a/ctdb/tests/tool/stubby.natgwlist.005.sh b/ctdb/tests/tool/stubby.natgwlist.005.sh new file mode 100755 index 0000000000..42c7dbbab5 --- /dev/null +++ b/ctdb/tests/tool/stubby.natgwlist.005.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +. "${TEST_SCRIPTS_DIR}/unit.sh" + +define_test "3 nodes, all stopped" + +setup_natgw <<EOF +192.168.20.41 +192.168.20.42 +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 +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 |