2005-06-14 06:34:13 +04:00
#!/bin/sh
2005-06-18 11:42:21 +04:00
echo "Running extended search tests"
2005-07-02 21:30:03 +04:00
mv $LDB_URL $LDB_URL .1
2005-06-14 06:34:13 +04:00
2012-01-26 02:42:27 +04:00
cat <<EOF | $VALGRIND ldbadd || exit 1
2005-06-22 07:08:06 +04:00
dn: cn = testrec1,cn= TEST
2005-06-14 06:34:13 +04:00
i1: 1
i2: 0
i3: 1234
i4: 0x7003004
2005-06-22 07:08:06 +04:00
dn: cn = testrec2,cn= TEST
2005-06-14 06:34:13 +04:00
i1: 0x800000
2005-06-22 07:08:06 +04:00
dn: cn = testrec3,cn= TEST
2005-06-14 06:34:13 +04:00
i1: 0x101010101
i1: 7
2005-06-14 07:37:43 +04:00
2005-06-22 07:08:06 +04:00
dn: cn = auser1,cn= TEST
2005-06-14 07:37:43 +04:00
groupType: 2147483648
samAccountType: 805306368
2005-06-22 07:08:06 +04:00
dn: cn = auser2,cn= TEST
2005-06-14 07:37:43 +04:00
groupType: 2147483648
samAccountType: 805306369
2005-06-22 07:08:06 +04:00
dn: cn = auser3,cn= TEST
2005-06-14 07:37:43 +04:00
groupType: 2147483649
samAccountType: 805306370
2005-06-22 07:08:06 +04:00
dn: cn = auser4,cn= TEST
2005-06-14 07:37:43 +04:00
groupType: 2147483649
samAccountType: 805306369
2005-06-14 06:34:13 +04:00
EOF
checkcount( ) {
count = $1
expression = " $2 "
2012-01-26 02:42:27 +04:00
n = ` $VALGRIND ldbsearch " $expression " | grep '^dn' | wc -l`
2005-06-14 06:34:13 +04:00
if [ $n != $count ] ; then
echo " Got $n but expected $count for $expression "
2012-01-26 02:42:27 +04:00
$VALGRIND ldbsearch " $expression "
2005-06-14 06:34:13 +04:00
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)'
2005-06-14 07:37:43 +04:00
# this is one that w2k gives
2005-06-14 11:50:18 +04:00
checkcount 3 '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))'
2005-06-14 07:37:43 +04:00