15 if [ x$status = x0 ]; then
19 failed=`expr $failed + 1`
26 check "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
28 echo "Getting defaultNamingContext"
29 BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
30 echo "BASEDN is $BASEDN"
32 check "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
34 check "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
36 nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(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))' sAMAccountName | grep sAMAccountName | wc -l`
37 echo "Found $nentries entries"
38 if [ $nentries -lt 10 ]; then
39 echo "Should have found at least 10 entries"
40 failed=`expr $failed + 1`
43 echo "Check rootDSE for Controls"
44 nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l`
45 if [ $nentries -lt 4 ]; then
46 echo "Should have found at least 4 entries"
47 failed=`expr $failed + 1`
50 echo "Test Paged Results Control"
51 nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l`
52 if [ $nentries -lt 1 ]; then
53 echo "Paged Results Control test returned 0 items"
54 failed=`expr $failed + 1`
57 echo "Test Server Sort Control"
58 nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l`
59 if [ $nentries -lt 1 ]; then
60 echo "Server Sort Control test returned 0 items"
61 failed=`expr $failed + 1`
64 echo "Test Extended DN Control"
65 nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l`
66 if [ $nentries -lt 1 ]; then
67 echo "Extended DN Control test returned 0 items"
68 failed=`expr $failed + 1`
71 echo "Test Attribute Scope Query Control"
72 nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l`
73 if [ $nentries -lt 1 ]; then
74 echo "Attribute Scope Query test returned 0 items"
75 failed=`expr $failed + 1`