diff --git a/src/test/ldap/README b/src/test/ldap/README index 4d641f92840..826b15373f2 100644 --- a/src/test/ldap/README +++ b/src/test/ldap/README @@ -49,4 +49,4 @@ and net/openldap24-server.) macOS: We do not recommend trying to use the Apple-provided version of OpenLDAP; it's very old, plus Apple seem to have changed the launching conventions for slapd. The paths in the test file are set on the -assumption that you installed OpenLDAP using Homebrew. +assumption that you installed OpenLDAP using Homebrew or MacPorts. diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index 431ad6442c3..6c02f2530b6 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -17,11 +17,18 @@ my ($slapd, $ldap_bin_dir, $ldap_schema_dir); $ldap_bin_dir = undef; # usually in PATH -if ($^O eq 'darwin') +if ($^O eq 'darwin' && -d '/usr/local/opt/openldap') { + # typical paths for Homebrew $slapd = '/usr/local/opt/openldap/libexec/slapd'; $ldap_schema_dir = '/usr/local/etc/openldap/schema'; } +elsif ($^O eq 'darwin' && -d '/opt/local/etc/openldap') +{ + # typical paths for MacPorts + $slapd = '/opt/local/libexec/slapd'; + $ldap_schema_dir = '/opt/local/etc/openldap/schema'; +} elsif ($^O eq 'linux') { $slapd = '/usr/sbin/slapd';