1#!/bin/sh 2 3echo "Running extended search tests" 4 5mv $LDB_URL $LDB_URL.1 6 7cat <<EOF | bin/ldbadd || exit 1 8dn: cn=testrec1,cn=TEST 9i1: 1 10i2: 0 11i3: 1234 12i4: 0x7003004 13 14dn: cn=testrec2,cn=TEST 15i1: 0x800000 16 17dn: cn=testrec3,cn=TEST 18i1: 0x101010101 19i1: 7 20 21dn: cn=auser1,cn=TEST 22groupType: 2147483648 23samAccountType: 805306368 24 25dn: cn=auser2,cn=TEST 26groupType: 2147483648 27samAccountType: 805306369 28 29dn: cn=auser3,cn=TEST 30groupType: 2147483649 31samAccountType: 805306370 32 33dn: cn=auser4,cn=TEST 34groupType: 2147483649 35samAccountType: 805306369 36EOF 37 38checkcount() { 39 count=$1 40 expression="$2" 41 n=`bin/ldbsearch "$expression" | grep '^dn' | wc -l` 42 if [ $n != $count ]; then 43 echo "Got $n but expected $count for $expression" 44 bin/ldbsearch "$expression" 45 exit 1 46 fi 47 echo "OK: $count $expression" 48} 49 50checkcount 1 '(i3=1234)' 51checkcount 0 '(i3=12345)' 52 53checkcount 2 '(i1:1.2.840.113556.1.4.803:=1)' 54checkcount 1 '(i1:1.2.840.113556.1.4.803:=3)' 55checkcount 1 '(i1:1.2.840.113556.1.4.803:=7)' 56checkcount 0 '(i1:1.2.840.113556.1.4.803:=15)' 57checkcount 1 '(i1:1.2.840.113556.1.4.803:=0x800000)' 58checkcount 1 '(i1:1.2.840.113556.1.4.803:=8388608)' 59 60checkcount 2 '(i1:1.2.840.113556.1.4.804:=1)' 61checkcount 2 '(i1:1.2.840.113556.1.4.804:=3)' 62checkcount 2 '(i1:1.2.840.113556.1.4.804:=7)' 63checkcount 2 '(i1:1.2.840.113556.1.4.804:=15)' 64checkcount 1 '(i1:1.2.840.113556.1.4.804:=0x800000)' 65checkcount 1 '(i1:1.2.840.113556.1.4.804:=8388608)' 66 67# this is one that w2k gives 68checkcount 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))' 69 70