Improve check in LDAP test to find the OpenLDAP installation
commite13b586d7c989147afd910c6997659a8412a8b84
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 7 Apr 2024 17:21:21 +0000 (7 20:21 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Sun, 7 Apr 2024 17:21:21 +0000 (7 20:21 +0300)
treee0d09d8c9fdcfe8f954535190ea82160ea46174b
parentb7b0f3f27241e424b7103397489464d907cef2c4
Improve check in LDAP test to find the OpenLDAP installation

If the OpenLDAP installation directory is not found, set $setup to 0
so that the LDAP tests are skipped. The macOS checks were already
doing that, but the checks on other OS's were not. While we're at it,
improve the error message when the tests are skipped, to specify
whether the OS is supported at all, or if we just didn't find the
installation directory.

This was accidentally "working" without this, i.e. we were skipping
the tests if the OpenLDAP installation was not found, because of a bug
in the LdapServer test module: the END block clobbered the exit code
so if the script die()s before running the first subtest, the whole
test script was marked as SKIPped. The next commit will fix that bug,
but we need to fix the setup code first.

These checks should probably go into configure/meson, but this is
better than nothing and allows fixing the bug in the END block.

Backpatch to all supported versions.

Discussion: https://www.postgresql.org/message-id/fb898a70-3a88-4629-88e9-f2375020061d@iki.fi
src/test/ldap/LdapServer.pm
src/test/ldap/t/001_auth.pl
src/test/ldap/t/002_bindpasswd.pl