Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (27 sloc) 0.964 kb
455ad0f @gbarr Initial revision
gbarr authored
1 #!perl
2
3 BEGIN {
4 require "t/common.pl";
5 start_server();
6 }
7
8 my $i = 4;
9
10
58b0c38 @gbarr A few tweaks to share some more code
gbarr authored
11 print "1..15\n";
455ad0f @gbarr Initial revision
gbarr authored
12
13 $ldap = client();
14 print "ok 1\n";
15
16 $mesg = $ldap->bind($MANAGERDN, password => $PASSWD);
17
58b0c38 @gbarr A few tweaks to share some more code
gbarr authored
18 print "# ",$mesg->code,": ",$mesg->error,"\nnot " if $mesg->code;
455ad0f @gbarr Initial revision
gbarr authored
19 print "ok 2\n";
20
58b0c38 @gbarr A few tweaks to share some more code
gbarr authored
21 print "not " unless ldif_populate($ldap, "data/51-in.ldif");
455ad0f @gbarr Initial revision
gbarr authored
22 print "ok 3\n";
23
24
25 # now search the database
26
27 # Exact searching
28 $mesg = $ldap->search(base => $BASEDN, filter => 'sn=jensen');
d442234 @gbarr Update test suite to work with either OpenLDAP1 or OpenLDAP2
gbarr authored
29 $i += compare_ldif("51a",$i,$mesg,$mesg->sorted);
455ad0f @gbarr Initial revision
gbarr authored
30
31 # Or searching
d442234 @gbarr Update test suite to work with either OpenLDAP1 or OpenLDAP2
gbarr authored
32 $mesg = $ldap->search(base => $BASEDN, filter => '(|(objectclass=groupofnames)(sn=jones))');
33 $i += compare_ldif("51b",$i,$mesg,$mesg->sorted);
455ad0f @gbarr Initial revision
gbarr authored
34
35 # And searching
d442234 @gbarr Update test suite to work with either OpenLDAP1 or OpenLDAP2
gbarr authored
36 $mesg = $ldap->search(base => $BASEDN, filter => '(&(objectclass=groupofnames)(cn=A*))');
37 $i += compare_ldif("51c",$i,$mesg,$mesg->sorted);
455ad0f @gbarr Initial revision
gbarr authored
38
39 # Not searching
40 $mesg = $ldap->search(base => $BASEDN, filter => '(!(objectclass=person))');
d442234 @gbarr Update test suite to work with either OpenLDAP1 or OpenLDAP2
gbarr authored
41 $i += compare_ldif("51d",$i,$mesg,$mesg->sorted);
455ad0f @gbarr Initial revision
gbarr authored
42
Something went wrong with that request. Please try again.