tests: Add a test for NAT gateway sanity checking
authorMartin Schwenke <martin@meltin.net>
Sun, 16 Mar 2014 19:15:39 +0000 (06:15 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 31 Mar 2014 02:32:29 +0000 (13:32 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
(Imported from commit c0e239473b532cebd31ef5e53d8cbf23c262c18d)

tests/eventscripts/11.natgw.002.sh [new file with mode: 0755]

diff --git a/tests/eventscripts/11.natgw.002.sh b/tests/eventscripts/11.natgw.002.sh
new file mode 100755 (executable)
index 0000000..e496e4a
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "missing config file"
+
+setup_ctdb
+setup_ctdb_natgw <<EOF
+192.168.1.21 master
+192.168.1.22
+192.168.1.23
+192.168.1.24
+EOF
+
+rm -f "$CTDB_NATGW_NODES"
+
+required_result 1 <<EOF
+error: CTDB_NATGW_NODES=${CTDB_NATGW_NODES} unreadable
+EOF
+
+for i in "startup" "ipreallocated" "monitor" ; do
+    simple_test_event "$i"
+done
+