postgresql/src/test/ldap
Peter Eisentraut 721856ff24 Remove distprep
A PostgreSQL release tarball contains a number of prebuilt files, in
particular files produced by bison, flex, perl, and well as html and
man documentation.  We have done this consistent with established
practice at the time to not require these tools for building from a
tarball.  Some of these tools were hard to get, or get the right
version of, from time to time, and shipping the prebuilt output was a
convenience to users.

Now this has at least two problems:

One, we have to make the build system(s) work in two modes: Building
from a git checkout and building from a tarball.  This is pretty
complicated, but it works so far for autoconf/make.  It does not
currently work for meson; you can currently only build with meson from
a git checkout.  Making meson builds work from a tarball seems very
difficult or impossible.  One particular problem is that since meson
requires a separate build directory, we cannot make the build update
files like gram.h in the source tree.  So if you were to build from a
tarball and update gram.y, you will have a gram.h in the source tree
and one in the build tree, but the way things work is that the
compiler will always use the one in the source tree.  So you cannot,
for example, make any gram.y changes when building from a tarball.
This seems impossible to fix in a non-horrible way.

Second, there is increased interest nowadays in precisely tracking the
origin of software.  We can reasonably track contributions into the
git tree, and users can reasonably track the path from a tarball to
packages and downloads and installs.  But what happens between the git
tree and the tarball is obscure and in some cases non-reproducible.

The solution for both of these issues is to get rid of the step that
adds prebuilt files to the tarball.  The tarball now only contains
what is in the git tree (*).  Getting the additional build
dependencies is no longer a problem nowadays, and the complications to
keep these dual build modes working are significant.  And of course we
want to get the meson build system working universally.

This commit removes the make distprep target altogether.  The make
dist target continues to do its job, it just doesn't call distprep
anymore.

(*) - The tarball also contains the INSTALL file that is built at make
dist time, but not by distprep.  This is unchanged for now.

The make maintainer-clean target, whose job it is to remove the
prebuilt files in addition to what make distclean does, is now just an
alias to make distprep.  (In practice, it is probably obsolete given
that git clean is available.)

The following programs are now hard build requirements in configure
(they were already required by meson.build):

- bison
- flex
- perl

Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Andres Freund <andres@anarazel.de>
Discussion: https://www.postgresql.org/message-id/flat/e07408d9-e5f2-d9fd-5672-f53354e9305e@eisentraut.org
2023-11-06 15:18:04 +01:00
..
t Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore Add LDAP authentication test suite 2017-09-15 11:44:29 -04:00
LdapServer.pm Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
README Doc: make src/test/*/README match current reality. 2023-02-07 14:30:30 -05:00
authdata.ldif Add LDAP authentication test suite 2017-09-15 11:44:29 -04:00
meson.build Add a test using ldapbindpasswd in pg_hba.conf 2023-01-23 08:40:18 -05:00

README

src/test/ldap/README

Tests for LDAP functionality
============================

This directory contains a test suite for LDAP functionality.  This
requires a full OpenLDAP installation, including server and client
tools, and is therefore kept separate and not run by default.  You
might need to adjust some paths in the test file to have it find
OpenLDAP in a place that hadn't been thought of yet.

Also, this test suite creates an LDAP server that listens for TCP/IP
connections on localhost without any real access control, so it is not
safe to run this on a system where there might be untrusted local
users.

Running the tests
=================

NOTE: You must have given the --enable-tap-tests argument to configure.

Run
    make check PG_TEST_EXTRA=ldap
or
    make installcheck PG_TEST_EXTRA=ldap
You can use "make installcheck" if you previously did "make install".
In that case, the code in the installation tree is tested.  With
"make check", a temporary installation tree is built from the current
sources and then tested.

Either way, this test initializes, starts, and stops a test Postgres
cluster, as well as a test LDAP server.

See src/test/perl/README for more info about running these tests.

Requirements
============

LDAP server and client tools are required.

Debian/Ubuntu packages: slapd ldap-utils

RHEL/CentOS/Fedora packages: openldap-clients openldap-servers
(You will already have needed openldap and openldap-devel to build.)

FreeBSD: openldap-server
(You will already have needed openldap-client to build.  If building
from the ports source tree, you want to build net/openldap24-client
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 or MacPorts.