summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2005-09-15 23:10:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:11 -0500
commitd8da5e4fb7534d2931a01bfc4b6f59bdca206c65 (patch)
tree49c2adff156206f2aaf55ab0bd50fc049d55a8c5 /source4/lib/ldb/tests
parent8bfcb31b0e01d42532db5837b1f0a070eb076bb1 (diff)
downloadsamba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.tar.gz
samba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.tar.bz2
samba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.zip
r10251: some more work on ldb_sqlite3
I must say that writing a new module is a very good way to find lot of subtle bugs laying in the code We need more tests! commit oLschema2ldif.c to keep it safe from data losses (rm -fr :-) update test generic to reflect the fix made on comparsion functions (This used to be commit 4357a2db5eadb15519ed93b957b2bad25ebf2a7d)
Diffstat (limited to 'source4/lib/ldb/tests')
-rwxr-xr-xsource4/lib/ldb/tests/test-generic.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/source4/lib/ldb/tests/test-generic.sh b/source4/lib/ldb/tests/test-generic.sh
index 0e2cb187a1..9060fe0f54 100755
--- a/source4/lib/ldb/tests/test-generic.sh
+++ b/source4/lib/ldb/tests/test-generic.sh
@@ -65,13 +65,13 @@ if [ $count != 3 ]; then
fi
echo "Testing compare"
-count=`$VALGRIND ldbsearch '(cn>=U)' cn | grep '^dn' | wc -l`
+count=`$VALGRIND ldbsearch '(cn>=t)' cn | grep '^dn' | wc -l`
if [ $count != 2 ]; then
echo returned $count records - expected 2
exit 1
fi
-count=`$VALGRIND ldbsearch '(cn<=U)' cn | grep '^dn' | wc -l`
+count=`$VALGRIND ldbsearch '(cn<=t)' cn | grep '^dn' | wc -l`
if [ $count != 13 ]; then
echo returned $count records - expected 13
exit 1
@@ -79,3 +79,24 @@ fi
echo "Testing binary file attribute value"
$VALGRIND ldbmodify $LDBDIR/tests/photo.ldif || exit 1
+
+checkcount() {
+ count=$1
+ scope=$2
+ basedn=$3
+ expression="$4"
+ n=`bin/ldbsearch -s "$scope" -b "$basedn" "$expression" | grep '^dn' | wc -l`
+ if [ $n != $count ]; then
+ echo "Got $n but expected $count for $expression"
+ bin/ldbsearch "$expression"
+ exit 1
+ fi
+ echo "OK: $count $expression"
+}
+
+checkcount 0 'base' '' '(uid=uham)'
+checkcount 0 'one' '' '(uid=uham)'
+
+checkcount 1 'base' 'cn=Hampster Ursula,ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' '(uid=uham)'
+checkcount 1 'one' 'ou=Alumni Association,ou=People,o=University of Michigan,c=TEST' '(uid=uham)'
+