s4-test: added dbcheck run to test suite
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2011 00:50:24 +0000 (10:50 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 21 Jul 2011 01:44:32 +0000 (11:44 +1000)
This should catch corruption that happens during a test run

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/selftest/quick
source4/selftest/tests.py
testprogs/blackbox/dbcheck.sh [new file with mode: 0755]

index 1827caf48f034a1dd2626de91b2ae5d50762e071..aa602fd383219cda53348b5f0c6bd08ab8a4fe11 100644 (file)
@@ -34,3 +34,4 @@ rpc.handles
 rpc.echo
 smb.signing
 drs.unit
+samba4.blackbox.dbcheck
index 292b428dc2f0cbe658df3c4b403fa3871659a0d8..9997628cee5608ae67a327f98c1dbbfe9f016f23 100755 (executable)
@@ -464,3 +464,6 @@ plantestsuite("samba4.blackbox.provision-backend.py", "none", ["PYTHON=%s" % pyt
 
 # Test renaming the DC
 plantestsuite("samba4.blackbox.renamedc.sh", "none", ["PYTHON=%s" % python, os.path.join(bbdir, "renamedc.sh"), '$PREFIX/provision'])
+
+# check the database is all OK. PLEASE LEAVE THIS AS THE LAST TEST
+plantestsuite("samba4.blackbox.dbcheck.sh", "dc:local", ["PYTHON=%s" % python, os.path.join(bbdir, "dbcheck.sh"), '$PREFIX/provision', configuration])
diff --git a/testprogs/blackbox/dbcheck.sh b/testprogs/blackbox/dbcheck.sh
new file mode 100755 (executable)
index 0000000..447d14a
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: dbcheck.sh PREFIX
+EOF
+exit 1;
+fi
+
+PREFIX="$1"
+shift 1
+
+. `dirname $0`/subunit.sh
+
+dbcheck() {
+       $BINDIR/samba-tool dbcheck --fix --cross-ncs --yes $@
+}
+
+testit "dbcheck" dbcheck
+
+exit $failed