ctdb-tests: Add "ctdb getmonmode/disablemonitor/enablemonitor" tool tests
authorMartin Schwenke <martin@meltin.net>
Fri, 15 Jul 2016 07:21:59 +0000 (17:21 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 25 Jul 2016 19:29:47 +0000 (21:29 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/tool/ctdb.disablemonitor.001.sh [new file with mode: 0755]
ctdb/tests/tool/ctdb.enablemonitor.001.sh [new file with mode: 0755]
ctdb/tests/tool/ctdb.getmonmode.001.sh [new file with mode: 0755]

diff --git a/ctdb/tests/tool/ctdb.disablemonitor.001.sh b/ctdb/tests/tool/ctdb.disablemonitor.001.sh
new file mode 100755 (executable)
index 0000000..d9380a1
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "basic monitor disable"
+
+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_null
+simple_test
+
+ok "DISABLED"
+simple_test_other getmonmode
+
+# Idempotence
+
+ok_null
+simple_test
+
+ok "DISABLED"
+simple_test_other getmonmode
diff --git a/ctdb/tests/tool/ctdb.enablemonitor.001.sh b/ctdb/tests/tool/ctdb.enablemonitor.001.sh
new file mode 100755 (executable)
index 0000000..cc1eea6
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "basic monitor enable"
+
+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_null
+simple_test_other disablemonitor
+
+ok "DISABLED"
+simple_test_other getmonmode
+
+ok_null
+simple_test
+
+ok "ENABLED"
+simple_test_other getmonmode
+
+# Idempotence
+
+ok_null
+simple_test
+
+ok "ENABLED"
+simple_test_other getmonmode
diff --git a/ctdb/tests/tool/ctdb.getmonmode.001.sh b/ctdb/tests/tool/ctdb.getmonmode.001.sh
new file mode 100755 (executable)
index 0000000..5e13dc7
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "basic get monitor mode"
+
+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 "ENABLED"
+simple_test