libpq: Add TAP tests for service files and names This commit adds a set of regression tests that checks various patterns with service names and service files, with: - Service file with no contents, used as default for PGSERVICEFILE to prevent any lookups at the HOME directory of an environment where the test is run. - Service file with valid service name and its section. - Service file at the root of PGSYSCONFDIR, named pg_service.conf. - Missing service file. - Service name defined as a connection parameter or as PGSERVICE.
Note that PGSYSCONFDIR is set to always point at a temporary directory created by the test, so as we never try to look at SYSCONFDIR. This set of tests has come up as a useful independent addition while discussing a patch that adds an equivalent of PGSERVICEFILE as a connection parameter as there have never been any tests for service files and service names. Torsten Foertsch and Ryo Kanbayashi have provided a basic implementation, that I have expanded to what is introduced in this commit. Author: Torsten Foertsch <tfoertsch...@gmail.com> Author: Ryo Kanbayashi <kanbayashi....@gmail.com> Author: Michael Paquier <mich...@paquier.xyz> Discussion: https://postgr.es/m/cakkg4_ncjx3a_f3gyxhspwxd8sd8uram89wey7fg_9g7kbk...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/72c2f36d572763201430a35414138c1b9ec3a106 Modified Files -------------- src/interfaces/libpq/meson.build | 1 + src/interfaces/libpq/t/006_service.pl | 141 ++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+)