ldb: Detect failures in ldb.base again
authorAndrew Bartlett <abartlet@samba.org>
Wed, 4 Apr 2012 08:52:25 +0000 (18:52 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 10 Apr 2012 06:57:06 +0000 (16:57 +1000)
We need to wrap the ldb tests in the subunit blackbox helpers.

We also needed to change to the right directory, or else the :< file://
syntax check does not work, as samba4.png is not found.

Andrew Bartlett

lib/ldb/tests/test-tdb-subunit.sh [new file with mode: 0755]
lib/ldb/tests/test-tdb.sh
lib/ldb/wscript
source4/selftest/tests.py

diff --git a/lib/ldb/tests/test-tdb-subunit.sh b/lib/ldb/tests/test-tdb-subunit.sh
new file mode 100755 (executable)
index 0000000..7dab79f
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+BINDIR=$1
+
+. `dirname $0`/../../../testprogs/blackbox/subunit.sh
+
+testit "ldb" `dirname $0`/test-tdb.sh $BINDIR
index c2285a93f1e4d41f76530881abf2168603eb6307..3310c81392615469b8bf12a0c913bbdc2d97a3dd 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+BINDIR=$1
+
 if [ -n "$TEST_DATA_PREFIX" ]; then
        LDB_URL="$TEST_DATA_PREFIX/tdbtest.ldb"
 else
@@ -7,16 +9,18 @@ else
 fi
 export LDB_URL
 
-PATH=bin:$PATH
+PATH=$BINDIR:$PATH
 export PATH
 
-rm -f $LDB_URL*
-
 if [ -z "$LDBDIR" ]; then
     LDBDIR=`dirname $0`/..
     export LDBDIR
 fi
 
+cd $LDBDIR
+
+rm -f $LDB_URL*
+
 cat <<EOF | $VALGRIND ldbadd || exit 1
 dn: @MODULES
 @LIST: rdn_name
index f297e9af948d3d9786158cc0dc7c06ff777f05c7..b2a23bfb1753f42a727301686e5a0cbfc89433ba 100755 (executable)
@@ -271,7 +271,7 @@ def test(ctx):
     shutil.rmtree(test_prefix, ignore_errors=True)
     os.makedirs(test_prefix)
     os.environ['TEST_DATA_PREFIX'] = test_prefix
-    cmd = 'tests/test-tdb.sh'
+    cmd = 'tests/test-tdb.sh %s' % Utils.g_module.blddir
     ret = samba_utils.RUN_COMMAND(cmd)
     print("testsuite returned %d" % ret)
     # FIXME: Run python testsuite
index f08417454a4e0a5285f28a15fbc42091b75dcfc5..8279ba4041061166fa672feecfcb2bb0527b885d 100755 (executable)
@@ -92,8 +92,7 @@ for t in smb4torture_testsuites("ldap."):
 ldbdir = os.path.join(srcdir(), "lib/ldb")
 # Don't run LDB tests when using system ldb, as we won't have ldbtest installed
 if os.path.exists(os.path.join(samba4bindir, "ldbtest")):
-    plantestsuite("ldb.base", "none", "%s/tests/test-tdb.sh" % ldbdir,
-                  allow_empty_output=True)
+    plantestsuite("ldb.base", "none", "%s/tests/test-tdb-subunit.sh %s" % (ldbdir, samba4bindir))
 else:
     skiptestsuite("ldb.base", "Using system LDB, ldbtest not available")