summaryrefslogtreecommitdiff
path: root/ctdb/tests/eventscripts/00.ctdb.init.008.sh
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-06-18 15:07:26 +1000
committerMartin Schwenke <martin@meltin.net>2013-06-20 13:01:10 +1000
commit3b2f7330cc333a55684753bf2c7b0fb8c8c72678 (patch)
tree82eb8a487d67bd0bce964daf51dc84804ab68f01 /ctdb/tests/eventscripts/00.ctdb.init.008.sh
parent4eed91b54a2c374a06c2275cbd8d4a50abbe9cdd (diff)
downloadsamba-3b2f7330cc333a55684753bf2c7b0fb8c8c72678.tar.gz
tests/eventscripts: New tests for 00.ctdb "init" event
These test dropping of IPs and TDB checking. New stubs for date, tdbdump, tdbtool. Enhance ip stub to handle "ip addr show to ..." Tweak some infrastructure. Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit aabf0bf41cb8ec344f06b69492fb6c2a27f9e900)
Diffstat (limited to 'ctdb/tests/eventscripts/00.ctdb.init.008.sh')
-rwxr-xr-xctdb/tests/eventscripts/00.ctdb.init.008.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/ctdb/tests/eventscripts/00.ctdb.init.008.sh b/ctdb/tests/eventscripts/00.ctdb.init.008.sh
new file mode 100755
index 00000000000..a6afdd8671f
--- /dev/null
+++ b/ctdb/tests/eventscripts/00.ctdb.init.008.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "TDB check, tdbtool supports check, bad persistent TDB"
+
+setup_ctdb
+
+FAKE_TDBTOOL_SUPPORTS_CHECK="yes"
+
+db="${CTDB_DBDIR}/persistent/foo.tdb.0"
+touch "$db"
+FAKE_TDB_IS_OK="no"
+
+required_result 1 <<EOF
+Persistent database ${db} is corrupted! CTDB will not start.
+EOF
+
+simple_test