You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



LDAP C SDK Acceptance Test README

Overview

Unfortunately, a comprehensive test suite does not exist for the LDAP C SDK. However, there is a simple acceptance test that developers are encouraged to run after making changes to the LDAP C SDK.

Use the following command to check out a copy of the acceptance test script:
cvs co -P mozilla/directory/tools/ldap/test-c-sdk

test-c-sdk is a Bourne shell script that uses the LDAP C SDK's command line tools to communicate with an LDAP server.

Preparation

Install or obtain access to a working LDAP server, ideally one that is configured to accept regular LDAP connections and secure (SSL) LDAP connections.

Load the sample Example.ldif file that Netscape ships with their Directory Server product into your LDAP server. To load that LDIF file, the LDAP server must be configured with a dc=example,dc=com naming context.

Create or obtain an NSS compatible client certificate database and place it under /tmp/certdb. The certificate database must contain a client certificate named Kirsten Vaughan's Example ID that your LDAP server will map to the Example.ldif entry uid=kvaughan,ou=People,dc=example,dc=com when the SASL/EXTERNAL bind method is used in conjunction with SSL. If it is inconvenient to use a certificate with that nickname, you may change the CERTNAME variable in the test-c-sdk script itself to another value.

Place copies of the NSS and NSPR shared libraries in a place where the test-c-sdk script can find them. By default, the script will look in these locations:

/shared-builds/nss/NSS_3_7_7_RTM
/shared-builds/nspr20/v4.2.2

If it is not convenient to use those file system paths, you can modify the NSS_RELEASE_ROOT and NSPR_RELEASE_ROOT variables in the test-c-sdk script, or you can use the -L option when running the script (see below).

Running the test-c-sdk Script

Follow these steps to run the acceptance test script:

  1. cd to the location of the LDAP C SDK binaries, e.g., cd mozilla/dist
  2. Invoke the script like so: test-c-sdk -h ldaphost -p ldapport -P ldapsport -W keyfilepasswd

The test-c-sdk script will try to run tests for as many platforms as it can find builds.

The keyfilepasswd is the passcode for the NSS key database you are using. Add the -s option to disable all SSL related tests (in which case you do not need to provide a passcode).

By default, the script will stop at the first error. Use the -c option to have the script keep going when it encounters errors.

To add to the search path used for NSS, NSPR, and other dependent libraries use the -L extra-lib-path option, e.g., -L /tmp/nss:/tmp/nspr

Add the -v option to enable verbose output. Add it twice (-v-v) to enable even more verbosity.

To enable man-in-the-middle checks for SSL, add the -3 option.

Known Issues

Some of the international (i18n) tests fail on Microsoft Windows.

The acceptance test modifies the data in your LDAP server. If the tests fail part way through, re-load a fresh copy of the Example.ldif file before running the tests again.

By default, the NSS shared library that contains the root certificate authorities is not copied to the certificate database location. To have it copied there, which was necessary at one point in the past, add the -C option when invoking the test-c-sdk script.