3 echo "Running tdb feature tests"
10 n=`$VALGRIND ldbsearch "$expression" | grep '^dn' | wc -l`
11 if [ $n != $count ]; then
12 echo "Got $n but expected $count for $expression"
13 $VALGRIND ldbsearch "$expression"
16 echo "OK: $count $expression"
19 echo "Testing case sensitive search"
20 cat <<EOF | $VALGRIND ldbadd || exit 1
22 objectClass: testclass
25 checkcount 1 '(test=foo)'
26 checkcount 0 '(test=FOO)'
27 checkcount 0 '(test=FO*)'
29 echo "Making case insensitive"
30 cat <<EOF | $VALGRIND ldbmodify || exit 1
34 test: CASE_INSENSITIVE
37 echo $ldif | $VALGRIND ldbmodify || exit 1
38 checkcount 1 '(test=foo)'
39 checkcount 1 '(test=FOO)'
40 checkcount 1 '(test=fo*)'
43 cat <<EOF | $VALGRIND ldbmodify || exit 1
49 checkcount 1 '(i=0x100)'
50 checkcount 0 '(i=256)'
52 echo "marking i as INTEGER"
53 cat <<EOF | $VALGRIND ldbmodify || exit 1
59 checkcount 1 '(i=0x100)'
60 checkcount 1 '(i=256)'
63 cat <<EOF | $VALGRIND ldbmodify || exit 1
69 checkcount 1 '(j=0x100)'
70 checkcount 0 '(j=256)'
72 echo "Adding wildcard attribute"
73 cat <<EOF | $VALGRIND ldbmodify || exit 1
79 checkcount 1 '(j=0x100)'
80 checkcount 1 '(j=256)'
82 echo "Testing class search"
83 checkcount 0 '(objectClass=otherclass)'
84 checkcount 1 '(objectClass=testclass)'
87 cat <<EOF | $VALGRIND ldbadd || exit 1
92 checkcount 1 '(i=0x100)'
93 checkcount 1 '(i=256)'
94 checkcount 0 '(i=-256)'
95 checkcount 1 '(test=foo)'
96 checkcount 1 '(test=FOO)'
97 checkcount 1 '(test=*f*o)'
99 echo "making test case sensitive"
100 cat <<EOF | $VALGRIND ldbmodify || exit 1
106 checkcount 1 '(test=foo)'
107 checkcount 0 '(test=FOO)'
108 checkcount 1 '(test=f*o*)'
114 n=`$VALGRIND ldbsearch -s one -b "$base" "$expression" | grep '^dn' | wc -l`
115 if [ $n != $count ]; then
116 echo "Got $n but expected $count for $expression"
117 $VALGRIND ldbsearch -s one -b "$base" "$expression"
120 echo "OK: $count $expression"
123 echo "Removing wildcard attribute"
124 cat <<EOF | $VALGRIND ldbmodify || exit 1
131 echo "Adding one level indexes"
132 cat <<EOF | $VALGRIND ldbmodify || exit 1
139 echo "Testing one level indexed search"
140 cat <<EOF | $VALGRIND ldbadd || exit 1
141 dn: cn=one,cn=t1,cn=TEST
142 objectClass: oneclass
146 checkone 1 "cn=t1,cn=TEST" '(test=one)'
147 cat <<EOF | $VALGRIND ldbadd || exit 1
148 dn: cn=two,cn=t1,cn=TEST
149 objectClass: oneclass
153 dn: cn=three,cn=t1,cn=TEST
154 objectClass: oneclass
158 checkone 3 "cn=t1,cn=TEST" '(test=one)'
159 checkone 1 "cn=t1,cn=TEST" '(cn=two)'