3 echo "Running tdb feature tests"
7 cat <<EOF | $VALGRIND ldbadd || exit 1
16 n
=$
($VALGRIND ldbsearch
"$expression" |
grep '^dn' |
wc -l)
17 if [ $n != $count ]; then
18 echo "Got $n but expected $count for $expression"
19 $VALGRIND ldbsearch
"$expression"
22 echo "OK: $count $expression"
25 echo "Testing case sensitive search"
26 cat <<EOF | $VALGRIND ldbadd || exit 1
28 objectClass: testclass
31 checkcount
1 '(test=foo)'
32 checkcount
0 '(test=FOO)'
33 checkcount
0 '(test=FO*)'
34 checkcount
1 '(cn=t1)'
36 echo "Making case insensitive"
37 cat <<EOF | $VALGRIND ldbmodify || exit 1
41 test: CASE_INSENSITIVE
44 echo $ldif |
$VALGRIND ldbmodify ||
exit 1
45 checkcount
1 '(test=foo)'
46 checkcount
1 '(test=FOO)'
47 checkcount
1 '(test=fo*)'
50 cat <<EOF | $VALGRIND ldbmodify || exit 1
56 checkcount
1 '(i=0x100)'
57 checkcount
0 '(i=256)'
59 echo "marking i as INTEGER"
60 cat <<EOF | $VALGRIND ldbmodify || exit 1
66 checkcount
1 '(i=0x100)'
67 checkcount
1 '(i=256)'
70 cat <<EOF | $VALGRIND ldbmodify || exit 1
76 checkcount
1 '(j=0x100)'
77 checkcount
0 '(j=256)'
79 echo "Adding wildcard attribute"
80 cat <<EOF | $VALGRIND ldbmodify || exit 1
86 checkcount
1 '(j=0x100)'
87 checkcount
1 '(j=256)'
89 cat <<EOF | $VALGRIND ldbadd || exit 1
93 echo "Testing search for attribute after change to use wildcard"
94 checkcount
1 '(num=1)'
96 echo "Testing class search"
97 checkcount
0 '(objectClass=otherclass)'
98 checkcount
1 '(objectClass=testclass)'
101 cat <<EOF | $VALGRIND ldbadd || exit 1
106 checkcount
1 '(i=0x100)'
107 checkcount
1 '(i=256)'
108 checkcount
0 '(i=-256)'
109 checkcount
1 '(test=foo)'
110 checkcount
1 '(test=FOO)'
111 checkcount
1 '(test=*f*o)'
113 echo "making test case sensitive"
114 cat <<EOF | $VALGRIND ldbmodify || exit 1
120 checkcount
1 '(test=foo)'
121 checkcount
0 '(test=FOO)'
122 checkcount
1 '(test=f*o*)'
129 n
=$
($VALGRIND ldbsearch
--scope=one
-b "$base" "$expression" |
grep '^dn' |
wc -l)
130 if [ $n != $count ]; then
131 echo "Got $n but expected $count for $expression"
132 $VALGRIND ldbsearch
--scope=one
-b "$base" "$expression"
135 echo "OK: $count $expression"
138 echo "Removing wildcard attribute"
139 cat <<EOF | $VALGRIND ldbmodify || exit 1
146 echo "Adding one level indexes"
147 cat <<EOF | $VALGRIND ldbmodify || exit 1
154 echo "Testing one level indexed search"
155 cat <<EOF | $VALGRIND ldbadd || exit 1
156 dn: cn=one,cn=t1,cn=TEST
157 objectClass: oneclass
161 checkone
1 "cn=t1,cn=TEST" '(test=one)'
162 cat <<EOF | $VALGRIND ldbadd || exit 1
163 dn: cn=two,cn=t1,cn=TEST
164 objectClass: oneclass
168 dn: cn=three,cn=t1,cn=TEST
169 objectClass: oneclass
173 dn: cn=four,cn=three,cn=t1,cn=TEST
174 objectClass: oneclass
178 checkone
3 "cn=t1,cn=TEST" '(test=one)'
179 checkone
1 "cn=t1,cn=TEST" '(cn=two)'