diff options
Diffstat (limited to 'source4')
-rwxr-xr-x | source4/lib/ldb/tests/test-extended.sh | 49 | ||||
-rwxr-xr-x | source4/lib/ldb/tests/test-tdb.sh | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/source4/lib/ldb/tests/test-extended.sh b/source4/lib/ldb/tests/test-extended.sh new file mode 100755 index 0000000000..246b55f5b9 --- /dev/null +++ b/source4/lib/ldb/tests/test-extended.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +rm -f $LDB_URL + +cat <<EOF | bin/ldbadd - || exit 1 +dn: testrec1 +i1: 1 +i2: 0 +i3: 1234 +i4: 0x7003004 + +dn: testrec2 +i1: 0x800000 + +dn: testrec3 +i1: 0x101010101 +i1: 7 +EOF + +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" +} + +checkcount 1 '(i3=1234)' +checkcount 0 '(i3=12345)' + +checkcount 2 '(i1:1.2.840.113556.1.4.803:=1)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=3)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=7)' +checkcount 0 '(i1:1.2.840.113556.1.4.803:=15)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=0x800000)' +checkcount 1 '(i1:1.2.840.113556.1.4.803:=8388608)' + +checkcount 2 '(i1:1.2.840.113556.1.4.804:=1)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=3)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=7)' +checkcount 2 '(i1:1.2.840.113556.1.4.804:=15)' +checkcount 1 '(i1:1.2.840.113556.1.4.804:=0x800000)' +checkcount 1 '(i1:1.2.840.113556.1.4.804:=8388608)' + +rm -f $LDB_URL diff --git a/source4/lib/ldb/tests/test-tdb.sh b/source4/lib/ldb/tests/test-tdb.sh index 69b30a50b4..9c2f9cd7ba 100755 --- a/source4/lib/ldb/tests/test-tdb.sh +++ b/source4/lib/ldb/tests/test-tdb.sh @@ -7,3 +7,4 @@ rm -f tdbtest.ldb . tests/test-generic.sh +. tests/test-extended.sh |