summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-10-14 04:43:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:21:00 -0500
commit2ad8e1443de55a005cb9249ba317ab8541ec7c90 (patch)
treef770faf7ff80afa3fde12694b62a9a59eee9317c /source4/lib/ldb/tests
parent57b8c5cd227d33b2eec34ed503b0b14c04344a87 (diff)
downloadsamba-2ad8e1443de55a005cb9249ba317ab8541ec7c90.tar.gz
samba-2ad8e1443de55a005cb9249ba317ab8541ec7c90.tar.bz2
samba-2ad8e1443de55a005cb9249ba317ab8541ec7c90.zip
r19273: - fixed error handling with the ldap backend
- propogate errors to the ldbadd command line tool - use the rdn_name module when testing the tdb backend to allow the same test code to correctly test the ldap and non-ldap backends (This used to be commit dd82c474a123d90329bda653a4cb73c93e087b15)
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/test-generic.sh17
-rwxr-xr-xsource4/lib/ldb/tests/test-tdb.sh7
-rw-r--r--source4/lib/ldb/tests/test.ldif5
3 files changed, 20 insertions, 9 deletions
diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh
index e4085c6d65..14337cc135 100755
--- a/source4/lib/ldb/tests/test-generic.sh
+++ b/source4/lib/ldb/tests/test-generic.sh
@@ -10,6 +10,12 @@ echo "LDB_URL: $LDB_URL"
echo "Adding base elements"
$VALGRIND ldbadd $LDBDIR/tests/test.ldif || exit 1
+echo "Adding again - should fail"
+ldbadd $LDBDIR/tests/test.ldif 2> /dev/null && {
+ echo "Should have failed to add again - gave $?"
+ exit 1
+}
+
echo "Modifying elements"
$VALGRIND ldbmodify $LDBDIR/tests/test-modify.ldif || exit 1
@@ -32,8 +38,11 @@ if [ $LDB_SPECIALS = 1 ]; then
$VALGRIND ldbadd $LDBDIR/tests/test-index.ldif || exit 1
fi
-echo "Adding attributes"
-$VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif || exit 1
+echo "Adding bad attributes - should fail"
+$VALGRIND ldbadd $LDBDIR/tests/test-wrong_attributes.ldif && {
+ echo "Should fhave failed - gave $?"
+ exit 1
+}
echo "testing indexed search"
$VALGRIND ldbsearch '(uid=uham)' || exit 1
@@ -75,7 +84,7 @@ echo "Testing binary file attribute value"
mkdir -p tests/tmp
cp $LDBDIR/tests/samba4.png tests/tmp/samba4.png
$VALGRIND ldbmodify $LDBDIR/tests/photo.ldif || exit 1
-count=`$VALGRIND ldbsearch '(cn=Ursula Hampster)' jpegPhoto | grep '^dn' | wc -l`
+count=`$VALGRIND ldbsearch '(cn=Hampster Ursula)' jpegPhoto | grep '^dn' | wc -l`
if [ $count != 1 ]; then
echo returned $count records - expected 1
exit 1
@@ -88,7 +97,7 @@ echo "Testing compare"
count=`$VALGRIND ldbsearch '(cn>=t)' cn | grep '^dn' | wc -l`
if [ $count != 2 ]; then
echo returned $count records - expected 2
- echo "this fails on opsnLdap ..."
+ echo "this fails on openLdap ..."
fi
count=`$VALGRIND ldbsearch '(cn<=t)' cn | grep '^dn' | wc -l`
diff --git a/source4/lib/ldb/tests/test-tdb.sh b/source4/lib/ldb/tests/test-tdb.sh
index e1052d1651..7c4f5205b4 100755
--- a/source4/lib/ldb/tests/test-tdb.sh
+++ b/source4/lib/ldb/tests/test-tdb.sh
@@ -17,6 +17,13 @@ if [ -z "$LDBDIR" ]; then
export LDBDIR
fi
+cat <<EOF | $VALGRIND ldbadd || exit 1
+dn: @MODULES
+@LIST: rdn_name
+EOF
+
+$VALGRIND ldbadd $LDBDIR/tests/init.ldif || exit 1
+
. $LDBDIR/tests/test-generic.sh
. $LDBDIR/tests/test-extended.sh
diff --git a/source4/lib/ldb/tests/test.ldif b/source4/lib/ldb/tests/test.ldif
index ab8b81437a..e53fadc700 100644
--- a/source4/lib/ldb/tests/test.ldif
+++ b/source4/lib/ldb/tests/test.ldif
@@ -409,8 +409,3 @@ homephone: +1 313 555 8421
pager: +1 313 555 2844
facsimiletelephonenumber: +1 313 555 9700
telephonenumber: +1 313 555 5331
-
-dn: ou=Ldb Test,ou=People,o=University of Michigan,c=TEST
-objectclass: organizationalUnit
-ou: Ldb Test
-