summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-07-13 10:50:24 +1000
committerAndrew Tridgell <tridge@samba.org>2011-07-21 11:44:32 +1000
commit190ec8796409870d5af2bcd53482cd56cd73f33e (patch)
treea759ce8f38115b4471576b4a145ed41232773bef
parenta8cba72119987803a806c3e05f3b5ac3c1be755d (diff)
downloadsamba-190ec8796409870d5af2bcd53482cd56cd73f33e.tar.gz
samba-190ec8796409870d5af2bcd53482cd56cd73f33e.tar.bz2
samba-190ec8796409870d5af2bcd53482cd56cd73f33e.zip
s4-test: added dbcheck run to test suite
This should catch corruption that happens during a test run Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/selftest/quick1
-rwxr-xr-xsource4/selftest/tests.py3
-rwxr-xr-xtestprogs/blackbox/dbcheck.sh21
3 files changed, 25 insertions, 0 deletions
diff --git a/source4/selftest/quick b/source4/selftest/quick
index 1827caf48f..aa602fd383 100644
--- a/source4/selftest/quick
+++ b/source4/selftest/quick
@@ -34,3 +34,4 @@ rpc.handles
rpc.echo
smb.signing
drs.unit
+samba4.blackbox.dbcheck
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index 292b428dc2..9997628cee 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -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
index 0000000000..447d14a8c8
--- /dev/null
+++ b/testprogs/blackbox/dbcheck.sh
@@ -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