![]() |
![]()
| ![]() |
![]()
NAMETest::OpenLDAP - Creates a temporary instance of OpenLDAP's slapd daemon to run tests against. VERSIONVersion 0.72 SYNOPSISmy $slapd = Test::OpenLDAP->new(); # Test::OpenLDAP->new( suffix => 'dc=foobar,dc=com', 'debug' => '-1' ); my $ldap = Net::LDAP->new($slapd->uri()) or Carp::croak("Failed to connect:$@"); my $mesg = $ldap->bind($slapd->admin_user(), password => $slapd->admin_password()); ... add / modify / search entries $slapd->stop(); $slapd->start(); $slapd->DESTROY(); DESCRIPTIONThis module allows easy creation and tear down of a OpenLDAP slapd instance. When the variable goes out of scope, the slapd instance is torn down and the file system objects it relies on are removed. SUBROUTINES/METHODSnewThis method initialises and starts an OpenLDAP slapd instance, listening on a unix socket. It then creates an admin user and password and returns the slapd instance to the user. The method accepts a hash of configuration options. The following keys are currently accepted;
skipThis method allows the user to skip tests requiring Test::OpenLDAP by checking to see if the slapd binary exists AND that the OS uses fork for process control. startThis methods starts the slapd process startThis method stops the slapd process uriThis method gives the uri for the test code to connect to via a Net::LDAP->new() call. suffixThis method gives the dn used as the suffix for the slapd database. admin_userThis method gives the admin user name for the slapd database. admin_passwordThis method gives the admin password for the slapd database. debugThis method gives the debug level that the slapd instance is reporting. debug_handleThis method gives a handle to the slapd debug log. set_cookieThis method sets the value for the "-c" argument to slapd. This can be used to force a reload for a replication consumer. get_cookieThis method gets the value for the "-c" argument to slapd. clear_cookieThis method clears the value for the "-c" argument to slapd. This can be used to reset the cookie in between stopping and starting slapd new_db_directoryThis method creates and returns a new database directory (for subsequent use with the olcDbDirectory attribute) DIAGNOSTICS
CONFIGURATION AND ENVIRONMENTTest::OpenLDAP requires no configuration files or environment variables. DEPENDENCIESTest::OpenLDAP requires the following non-core Perl modules
INCOMPATIBILITIESNone reported AUTHORDavid Dick, "<ddick at cpan.org>" BUGS AND LIMITATIONSPlease report any bugs or feature requests to "bug-test-openldap at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-OpenLDAP>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORTYou can find documentation for this module with the perldoc command. perldoc Test::OpenLDAP You can also look for information at:
LICENSE AND COPYRIGHTCopyright 2017 David Dick. This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License. See http://dev.perl.org/licenses/ for more information.
|