diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-04-04 18:52:25 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-10 16:57:06 +1000 |
commit | c484f259c66ffcf0649dd5ab0d7c86e5c70d31af (patch) | |
tree | 776914f0ea58307c41d4734365d2f2a168f8f3aa | |
parent | 57341c0f29911d09e511c840386a35290febb9f9 (diff) | |
download | samba-c484f259c66ffcf0649dd5ab0d7c86e5c70d31af.tar.gz samba-c484f259c66ffcf0649dd5ab0d7c86e5c70d31af.tar.bz2 samba-c484f259c66ffcf0649dd5ab0d7c86e5c70d31af.zip |
ldb: Detect failures in ldb.base again
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
-rwxr-xr-x | lib/ldb/tests/test-tdb-subunit.sh | 7 | ||||
-rwxr-xr-x | lib/ldb/tests/test-tdb.sh | 10 | ||||
-rwxr-xr-x | lib/ldb/wscript | 2 | ||||
-rwxr-xr-x | source4/selftest/tests.py | 3 |
4 files changed, 16 insertions, 6 deletions
diff --git a/lib/ldb/tests/test-tdb-subunit.sh b/lib/ldb/tests/test-tdb-subunit.sh new file mode 100755 index 0000000000..7dab79f7ba --- /dev/null +++ b/lib/ldb/tests/test-tdb-subunit.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +BINDIR=$1 + +. `dirname $0`/../../../testprogs/blackbox/subunit.sh + +testit "ldb" `dirname $0`/test-tdb.sh $BINDIR diff --git a/lib/ldb/tests/test-tdb.sh b/lib/ldb/tests/test-tdb.sh index c2285a93f1..3310c81392 100755 --- a/lib/ldb/tests/test-tdb.sh +++ b/lib/ldb/tests/test-tdb.sh @@ -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 diff --git a/lib/ldb/wscript b/lib/ldb/wscript index f297e9af94..b2a23bfb17 100755 --- a/lib/ldb/wscript +++ b/lib/ldb/wscript @@ -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 diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index f08417454a..8279ba4041 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -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") |