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