svn commit: samba r8009 - in branches/SAMBA_4_0/source/lib/ldb/tests: .

tridge at samba.org tridge at samba.org
Thu Jun 30 03:32:43 GMT 2005


Author: tridge
Date: 2005-06-30 03:32:43 +0000 (Thu, 30 Jun 2005)
New Revision: 8009

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8009

Log:
expanded the ldb test suite. It worried me that some changes I have
pending, which I know break lots of features, still passed our test
suite! Now they don't.

Added:
   branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb-features.sh
Modified:
   branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh


Changeset:
Added: branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb-features.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb-features.sh	2005-06-30 03:29:48 UTC (rev 8008)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb-features.sh	2005-06-30 03:32:43 UTC (rev 8009)
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+echo "Running tdb feature tests"
+
+rm -f $LDB_URL
+
+checkcount() {
+    count=$1
+    expression="$2"
+    n=`bin/ldbsearch "$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"
+}
+
+echo "Testing case sensitve search"
+cat <<EOF | bin/ldbadd || exit 1
+dn: cn=t1,cn=TEST
+test: foo
+EOF
+
+
+echo $ldif | bin/ldbadd || exit 1
+bin/ldbsearch
+
+checkcount 1 '(test=foo)'
+checkcount 0 '(test=FOO)'
+checkcount 0 '(test=fo*)'
+
+echo "Making case insensitive"
+cat <<EOF | bin/ldbmodify || exit 1
+dn: @ATTRIBUTES
+changetype: add
+add: test
+test: CASE_INSENSITIVE
+EOF
+
+echo $ldif | bin/ldbmodify || exit 1
+checkcount 1 '(test=foo)'
+checkcount 1 '(test=FOO)'
+checkcount 0 '(test=fo*)'
+
+echo "adding wildcard"
+cat <<EOF | bin/ldbmodify || exit 1
+dn: @ATTRIBUTES
+changetype: modify
+add: test
+test: WILDCARD
+EOF
+checkcount 1 '(test=foo)'
+checkcount 1 '(test=FOO)'
+checkcount 1 '(test=fo*)'
+
+echo "adding i"
+cat <<EOF | bin/ldbmodify || exit 1
+dn: cn=t1,cn=TEST
+changetype: modify
+add: i
+i: 0x100
+EOF
+checkcount 1 '(i=0x100)'
+checkcount 0 '(i=256)'
+
+echo "marking i as INTEGER"
+cat <<EOF | bin/ldbmodify || exit 1
+dn: @ATTRIBUTES
+changetype: modify
+add: i
+i: INTEGER
+EOF
+checkcount 1 '(i=0x100)'
+checkcount 1 '(i=256)'
+
+
+rm -f $LDB_URL

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh	2005-06-30 03:29:48 UTC (rev 8008)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-tdb.sh	2005-06-30 03:32:43 UTC (rev 8009)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
 
-export LDB_URL="tdb://tdbtest.ldb"
+export LDB_URL="tdbtest.ldb"
 
 rm -f tdbtest.ldb
 
 . tests/test-generic.sh
 
 . tests/test-extended.sh
+
+. tests/test-tdb-features.sh



More information about the samba-cvs mailing list