diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:05:26 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-21 05:05:26 +0000 |
commit | e75d99818dd3940be997520e64db8c9e3b207e39 (patch) | |
tree | 0003ca0de74fcc8d18433e34ea68d2e7aaf06b7c /src/test/ldap/t/001_auth.pl | |
parent | Releasing progress-linux version 15.6-0+deb12u1~progress6.99u1. (diff) | |
download | postgresql-15-e75d99818dd3940be997520e64db8c9e3b207e39.tar.xz postgresql-15-e75d99818dd3940be997520e64db8c9e3b207e39.zip |
Merging upstream version 15.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ldap/t/001_auth.pl')
-rw-r--r-- | src/test/ldap/t/001_auth.pl | 88 |
1 files changed, 63 insertions, 25 deletions
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl index 2a7435e..3dd56e9 100644 --- a/src/test/ldap/t/001_auth.pl +++ b/src/test/ldap/t/001_auth.pl @@ -16,44 +16,77 @@ if ($ENV{with_ldap} ne 'yes') { plan skip_all => 'LDAP not supported by this build'; } -elsif ($^O eq 'darwin' && -d '/opt/homebrew/opt/openldap') +# Find the OpenLDAP server binary and directory containing schema +# definition files. +elsif ($^O eq 'darwin') { - # typical paths for Homebrew on ARM - $slapd = '/opt/homebrew/opt/openldap/libexec/slapd'; - $ldap_schema_dir = '/opt/homebrew/etc/openldap/schema'; -} -elsif ($^O eq 'darwin' && -d '/usr/local/opt/openldap') -{ - # typical paths for Homebrew on Intel - $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'; + if (-d '/opt/homebrew/opt/openldap') + { + # typical paths for Homebrew on ARM + $slapd = '/opt/homebrew/opt/openldap/libexec/slapd'; + $ldap_schema_dir = '/opt/homebrew/etc/openldap/schema'; + } + elsif (-d '/usr/local/opt/openldap') + { + # typical paths for Homebrew on Intel + $slapd = '/usr/local/opt/openldap/libexec/slapd'; + $ldap_schema_dir = '/usr/local/etc/openldap/schema'; + } + elsif (-d '/opt/local/etc/openldap') + { + # typical paths for MacPorts + $slapd = '/opt/local/libexec/slapd'; + $ldap_schema_dir = '/opt/local/etc/openldap/schema'; + } + else + { + plan skip_all => "OpenLDAP server installation not found"; + } } elsif ($^O eq 'linux') { - $slapd = '/usr/sbin/slapd'; - $ldap_schema_dir = '/etc/ldap/schema' if -d '/etc/ldap/schema'; - $ldap_schema_dir = '/etc/openldap/schema' if -d '/etc/openldap/schema'; + if (-d '/etc/ldap/schema') + { + $slapd = '/usr/sbin/slapd'; + $ldap_schema_dir = '/etc/ldap/schema'; + } + elsif (-d '/etc/openldap/schema') + { + $slapd = '/usr/sbin/slapd'; + $ldap_schema_dir = '/etc/openldap/schema'; + } + else + { + plan skip_all => "OpenLDAP server installation not found"; + } } elsif ($^O eq 'freebsd') { - $slapd = '/usr/local/libexec/slapd'; - $ldap_schema_dir = '/usr/local/etc/openldap/schema'; + if (-d '/usr/local/etc/openldap/schema') + { + $slapd = '/usr/local/libexec/slapd'; + $ldap_schema_dir = '/usr/local/etc/openldap/schema'; + } + else + { + plan skip_all => "OpenLDAP server installation not found"; + } } elsif ($^O eq 'openbsd') { - $slapd = '/usr/local/libexec/slapd'; - $ldap_schema_dir = '/usr/local/share/examples/openldap/schema'; + if (-d '/usr/local/share/examples/openldap/schema') + { + $slapd = '/usr/local/libexec/slapd'; + $ldap_schema_dir = '/usr/local/share/examples/openldap/schema'; + } + else + { + plan skip_all => "OpenLDAP server installation not found"; + } } else { - plan skip_all => - "ldap tests not supported on $^O or dependencies not installed"; + plan skip_all => "ldap tests not supported on $^O"; } # make your own edits here @@ -130,7 +163,12 @@ system_or_bail $slapd, '-f', $slapd_conf,'-s0', '-h', "$ldap_url $ldaps_url"; END { + # take care not to change the script's exit value + my $exit_code = $?; + kill 'INT', `cat $slapd_pidfile` if -f $slapd_pidfile; + + $? = $exit_code; } append_to_file($ldap_pwfile, $ldap_rootpw); |