diff options
author | Simo Sorce <idra@samba.org> | 2006-02-05 20:48:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:51:48 -0500 |
commit | 3721bca79dc6ff409085a2fc40cbd060d25191d4 (patch) | |
tree | e4c20147b801904d7f00a8e99d5054cb8fb80a75 /source4/script | |
parent | 096c2dc10362150aed84f2251fa8ff26c3a535bb (diff) | |
download | samba-3721bca79dc6ff409085a2fc40cbd060d25191d4.tar.gz samba-3721bca79dc6ff409085a2fc40cbd060d25191d4.tar.bz2 samba-3721bca79dc6ff409085a2fc40cbd060d25191d4.zip |
r13354: Add tests to check that controls work properly
Fix asq module, add a second_stage_init to register with rootdse
Fix asq control ldap parsing routines (this was nasty to find out)
(This used to be commit 933a80397d137f7d5b79c82a068d62bb6928ef47)
Diffstat (limited to 'source4/script')
-rwxr-xr-x | source4/script/tests/test_ldap.sh | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/source4/script/tests/test_ldap.sh b/source4/script/tests/test_ldap.sh index 37baaf9277..fc2b27028f 100755 --- a/source4/script/tests/test_ldap.sh +++ b/source4/script/tests/test_ldap.sh @@ -37,13 +37,42 @@ for p in $PROTOCOLS; do testit "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1` - nusers=`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` - echo "Found $nusers users" - if [ $nusers -lt 10 ]; then - echo "Should have found at least 10 users" + 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` + echo "Found $nentries entries" + if [ $nentries -lt 10 ]; then + echo "Should have found at least 10 entries" failed=`expr $failed + 1` fi -done + + echo "Test Paged Results Control" + nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l` + if [ $nentries -lt 1 ]; then + echo "Paged Results Control test returned 0 items" + failed=`expr $failed + 1` + fi + + echo "Test Server Sort Control" + nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l` + if [ $nentries -lt 1 ]; then + echo "Server Sort Control test returned 0 items" + failed=`expr $failed + 1` + fi + + echo "Test Extended DN Control" + nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l` + if [ $nentries -lt 1 ]; then + echo "Extended DN Control test returned 0 items" + failed=`expr $failed + 1` + fi + + echo "Test Attribute Scope Query Control" + nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b 'CN=Administrators,CN=Builtin,DC=samba,DC=example,DC=com' | grep sAMAccountName | wc -l` + if [ $nentries -lt 1 ]; then + echo "Attribute Scope Query test returned 0 items" + failed=`expr $failed + 1` + fi + + done done testit "CLDAP" bin/smbtorture $TORTURE_OPTIONS //$SERVER/_none_ LDAP-CLDAP || failed=`expr $failed + 1` |