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