summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tests
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-01 02:17:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:00 -0500
commit64307e63513bd47de25c031321c91ebc56a4aef3 (patch)
tree6444914d9191ae6734b2df9582f24c6ef1b950dd /source4/lib/ldb/tests
parent9cfe2d83f1103f83ace2ead46e31d7368a29f3c0 (diff)
downloadsamba-64307e63513bd47de25c031321c91ebc56a4aef3.tar.gz
samba-64307e63513bd47de25c031321c91ebc56a4aef3.tar.bz2
samba-64307e63513bd47de25c031321c91ebc56a4aef3.zip
r8033: - add easier valgrind testing
- add tests for the @SUBCLASSES ltdb special (This used to be commit ad6e62fdcf0432fcf4d41edb1727cbba1b7528b7)
Diffstat (limited to 'source4/lib/ldb/tests')
-rw-r--r--source4/lib/ldb/tests/test-tdb-features.sh36
1 files changed, 25 insertions, 11 deletions
diff --git a/source4/lib/ldb/tests/test-tdb-features.sh b/source4/lib/ldb/tests/test-tdb-features.sh
index 80da8fc2ad..8e9d9dab3c 100644
--- a/source4/lib/ldb/tests/test-tdb-features.sh
+++ b/source4/lib/ldb/tests/test-tdb-features.sh
@@ -10,41 +10,41 @@ checkcount() {
n=`bin/ldbsearch "$expression" | grep ^dn | wc -l`
if [ $n != $count ]; then
echo "Got $n but expected $count for $expression"
- bin/ldbsearch "$expression"
+ $VALGRIND bin/ldbsearch "$expression"
exit 1
fi
echo "OK: $count $expression"
}
echo "Testing case sensitve search"
-cat <<EOF | bin/ldbadd || exit 1
+cat <<EOF | $VALGRIND bin/ldbadd || exit 1
dn: cn=t1,cn=TEST
+objectClass: testclass
test: foo
EOF
-echo $ldif | bin/ldbadd || exit 1
-bin/ldbsearch
+echo $ldif | $VALGRIND bin/ldbadd || exit 1
checkcount 1 '(test=foo)'
checkcount 0 '(test=FOO)'
checkcount 0 '(test=fo*)'
echo "Making case insensitive"
-cat <<EOF | bin/ldbmodify || exit 1
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: @ATTRIBUTES
changetype: add
add: test
test: CASE_INSENSITIVE
EOF
-echo $ldif | bin/ldbmodify || exit 1
+echo $ldif | $VALGRIND 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
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: @ATTRIBUTES
changetype: modify
add: test
@@ -55,7 +55,7 @@ checkcount 1 '(test=FOO)'
checkcount 1 '(test=fo*)'
echo "adding i"
-cat <<EOF | bin/ldbmodify || exit 1
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: cn=t1,cn=TEST
changetype: modify
add: i
@@ -65,7 +65,7 @@ checkcount 1 '(i=0x100)'
checkcount 0 '(i=256)'
echo "marking i as INTEGER"
-cat <<EOF | bin/ldbmodify || exit 1
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: @ATTRIBUTES
changetype: modify
add: i
@@ -75,7 +75,7 @@ checkcount 1 '(i=0x100)'
checkcount 1 '(i=256)'
echo "adding j"
-cat <<EOF | bin/ldbmodify || exit 1
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: cn=t1,cn=TEST
changetype: modify
add: j
@@ -85,7 +85,7 @@ checkcount 1 '(j=0x100)'
checkcount 0 '(j=256)'
echo "Adding wildcard attribute"
-cat <<EOF | bin/ldbmodify || exit 1
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
dn: @ATTRIBUTES
changetype: modify
add: *
@@ -94,4 +94,18 @@ EOF
checkcount 1 '(j=0x100)'
checkcount 1 '(j=256)'
+echo "Testing class search"
+checkcount 0 '(objectClass=otherclass)'
+checkcount 1 '(objectClass=testclass)'
+
+echo "Adding subclass"
+cat <<EOF | $VALGRIND bin/ldbmodify || exit 1
+dn: @SUBCLASSES
+changetype: add
+add: otherclass
+otherclass: testclass
+EOF
+checkcount 1 '(objectClass=otherclass)'
+checkcount 1 '(objectClass=testclass)'
+
rm -f $LDB_URL