summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-01 07:23:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:01 -0500
commit036a7dd9f8310d8bf380c8947f3ee76c51bcf6d0 (patch)
tree90f24f216ee5ea31810f658efb69ab661baa8308
parentbd7812be319556162b22562a7c9670dce00d90f9 (diff)
downloadsamba-036a7dd9f8310d8bf380c8947f3ee76c51bcf6d0.tar.gz
samba-036a7dd9f8310d8bf380c8947f3ee76c51bcf6d0.tar.bz2
samba-036a7dd9f8310d8bf380c8947f3ee76c51bcf6d0.zip
r8039: allow ldb test suite to be run outside of the ldb directory
(This used to be commit f3e3b2ccd93b87c1c240cf7e44106389b089b526)
-rwxr-xr-xsource4/lib/ldb/tests/test-generic.sh44
-rwxr-xr-xsource4/lib/ldb/tests/test-schema.sh14
-rwxr-xr-xsource4/lib/ldb/tests/test-sqlite3.sh2
-rwxr-xr-xsource4/lib/ldb/tests/test-tdb.sh14
4 files changed, 41 insertions, 33 deletions
diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh
index 9b59261003..607b3f7851 100755
--- a/source4/lib/ldb/tests/test-generic.sh
+++ b/source4/lib/ldb/tests/test-generic.sh
@@ -3,57 +3,57 @@
echo "LDB_URL: $LDB_URL"
echo "Adding base elements"
-$VALGRIND bin/ldbadd tests/test.ldif || exit 1
+$VALGRIND ldbadd $LDBDIR/tests/test.ldif || exit 1
echo "Modifying elements"
-$VALGRIND bin/ldbmodify tests/test-modify.ldif || exit 1
+$VALGRIND ldbmodify $LDBDIR/tests/test-modify.ldif || exit 1
echo "Showing modified record"
-$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
+$VALGRIND ldbsearch '(uid=uham)' || exit 1
echo "Rename entry"
OLDDN="cn=Ursula Hampster,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST"
NEWDN="cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST"
-$VALGRIND bin/ldbrename "$OLDDN" "$NEWDN" || exit 1
+$VALGRIND ldbrename "$OLDDN" "$NEWDN" || exit 1
echo "Showing renamed record"
-$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
+$VALGRIND ldbsearch '(uid=uham)' || exit 1
echo "Starting ldbtest"
-time $VALGRIND bin/ldbtest --num-records 1000 --num-searches 10 || exit 1
+time $VALGRIND ldbtest --num-records 1000 --num-searches 10 || exit 1
echo "Adding index"
-$VALGRIND bin/ldbadd tests/test-index.ldif || exit 1
+$VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1
echo "Adding attributes"
-$VALGRIND bin/ldbadd tests/test-wrong_attributes.ldif || exit 1
+$VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif || exit 1
echo "testing indexed search"
-$VALGRIND bin/ldbsearch '(uid=uham)' || exit 1
-$VALGRIND bin/ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1
-$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uham))' || exit 1
-$VALGRIND bin/ldbsearch '(|(uid=uham)(uid=uham))' || exit 1
-$VALGRIND bin/ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1
-$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1
-$VALGRIND bin/ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1
-$VALGRIND bin/ldbsearch '(&(uid=uham)(uid=uha*)(title=*))' uid || exit 1
+$VALGRIND ldbsearch '(uid=uham)' || exit 1
+$VALGRIND ldbsearch '(&(objectclass=person)(objectclass=person)(objectclass=top))' || exit 1
+$VALGRIND ldbsearch '(&(uid=uham)(uid=uham))' || exit 1
+$VALGRIND ldbsearch '(|(uid=uham)(uid=uham))' || exit 1
+$VALGRIND ldbsearch '(|(uid=uham)(uid=uham)(objectclass=OpenLDAPperson))' || exit 1
+$VALGRIND ldbsearch '(&(uid=uham)(uid=uham)(!(objectclass=xxx)))' || exit 1
+$VALGRIND ldbsearch '(&(objectclass=person)(uid=uham)(!(uid=uhamxx)))' uid \* \+ dn || exit 1
+$VALGRIND ldbsearch '(&(uid=uham)(uid=uha*)(title=*))' uid || exit 1
# note that the "((" is treated as an attribute not an expression
# this matches the openldap ldapsearch behaviour of looking for a '='
# to see if the first argument is an expression or not
-$VALGRIND bin/ldbsearch '((' uid || exit 1
-$VALGRIND bin/ldbsearch '(objectclass=)' uid || exit 1
-$VALGRIND bin/ldbsearch -b 'cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' -s base "" sn || exit 1
+$VALGRIND ldbsearch '((' uid || exit 1
+$VALGRIND ldbsearch '(objectclass=)' uid || exit 1
+$VALGRIND ldbsearch -b 'cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' -s base "" sn || exit 1
echo "Starting ldbtest indexed"
-time $VALGRIND bin/ldbtest --num-records 1000 --num-searches 5000 || exit 1
+time $VALGRIND ldbtest --num-records 1000 --num-searches 5000 || exit 1
echo "Testing one level search"
-count=`$VALGRIND bin/ldbsearch -b 'ou=Groups,o=University of Michigan,c=TEST' -s one 'objectclass=*' none |grep ^dn | wc -l`
+count=`$VALGRIND ldbsearch -b 'ou=Groups,o=University of Michigan,c=TEST' -s one 'objectclass=*' none |grep ^dn | wc -l`
if [ "$count" != 3 ]; then
echo returned $count records - expected 3
exit 1
fi
echo "Testing binary file attribute value"
-$VALGRIND bin/ldbmodify tests/photo.ldif || exit 1
+$VALGRIND ldbmodify $LDBDIR/tests/photo.ldif || exit 1
diff --git a/source4/lib/ldb/tests/test-schema.sh b/source4/lib/ldb/tests/test-schema.sh
index 08595a0a9c..a8af8a38e2 100755
--- a/source4/lib/ldb/tests/test-schema.sh
+++ b/source4/lib/ldb/tests/test-schema.sh
@@ -7,22 +7,22 @@ rm -f schema.ldb
echo "LDB_URL: $LDB_URL"
echo "Adding schema"
-$VALGRIND bin/ldbadd tests/schema-tests/schema.ldif || exit 1
+$VALGRIND bin/ldbadd $LDBDIR/tests/schema-tests/schema.ldif || exit 1
echo "Adding few test elements (no failure expected here)"
-$VALGRIND bin/ldbadd tests/schema-tests/schema-add-test.ldif || exit 1
+$VALGRIND bin/ldbadd $LDBDIR/tests/schema-tests/schema-add-test.ldif || exit 1
echo "Modifying elements (2 failures expected here)"
-$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-1.ldif || exit 1
-$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-2.ldif || exit 1
-$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-3.ldif || exit 1
-$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-4.ldif
+$VALGRIND bin/ldbmodify $LDBDIR/tests/schema-tests/schema-mod-test-1.ldif || exit 1
+$VALGRIND bin/ldbmodify $LDBDIR/tests/schema-tests/schema-mod-test-2.ldif || exit 1
+$VALGRIND bin/ldbmodify $LDBDIR/tests/schema-tests/schema-mod-test-3.ldif || exit 1
+$VALGRIND bin/ldbmodify $LDBDIR/tests/schema-tests/schema-mod-test-4.ldif
if [ "$?" == "0" ]; then
echo "test failed!"
exit 1
fi
-$VALGRIND bin/ldbmodify tests/schema-tests/schema-mod-test-5.ldif
+$VALGRIND bin/ldbmodify $LDBDIR/tests/schema-tests/schema-mod-test-5.ldif
if [ "$?" == "0" ]; then
echo "test failed!"
exit 1
diff --git a/source4/lib/ldb/tests/test-sqlite3.sh b/source4/lib/ldb/tests/test-sqlite3.sh
index 95babeac8d..7e0c96feaf 100755
--- a/source4/lib/ldb/tests/test-sqlite3.sh
+++ b/source4/lib/ldb/tests/test-sqlite3.sh
@@ -5,5 +5,5 @@ export LDB_URL="sqlite:///var/tmp/test.ldb"
rm -f sqltest.ldb
-. tests/test-generic.sh
+. $LDBDIR/tests/test-generic.sh
diff --git a/source4/lib/ldb/tests/test-tdb.sh b/source4/lib/ldb/tests/test-tdb.sh
index 470975e8b8..3d461b0b3f 100755
--- a/source4/lib/ldb/tests/test-tdb.sh
+++ b/source4/lib/ldb/tests/test-tdb.sh
@@ -3,10 +3,18 @@
export LDB_URL="tdbtest.ldb"
+PATH=bin:$PATH
+export PATH
+
rm -f tdbtest.ldb
-. tests/test-generic.sh
+if [ -z "$LDBDIR" ]; then
+ LDBDIR="."
+ export LDBDIR
+fi
+
+. $LDBDIR/tests/test-generic.sh
-. tests/test-extended.sh
+. $LDBDIR/tests/test-extended.sh
-. tests/test-tdb-features.sh
+. $LDBDIR/tests/test-tdb-features.sh