Re: [PATCH] Add peer authentication TAP test

Anton A. Melnikov <aamelnikov@inbox.ru>

From: "Anton A. Melnikov" <aamelnikov@inbox.ru>
To: Michael Paquier <michael@paquier.xyz>
Cc: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-11-25T07:13:29Z
Lists: pgsql-hackers

Attachments

Hello, thanks for rapid answer!

On 25.11.2022 08:18, Michael Paquier wrote:
> You are not using MSVC but MinGW, are you?  The buildfarm members with
> TAP tests enabled are drongo, fairywren, bowerbord and jacana.  Even
> though none of them are running the tests from
> src/test/authentication/, this is running on a periodic basis in the
> CI, where we are able to skip the test in MSVC already:
> postgresql:authentication / authentication/003_peer SKIP 9.73s

There is MSVC on my PC. The project was build with
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30136 for x64

> So yes, it is plausible that we are missing more safeguards here.
> 
> Your suggestion to skip under !$use_unix_sockets makes sense, as not
> having unix sockets is not going to work for peer and WIN32 needs SSPI
> to be secure with pg_regress.  Where is your test failing?  On the
> first $node->psql('postgres') at the beginning of the test?  Just
> wondering..

The test fails almost at the beginning in reset_pg_hba call after
modification pg_hba.conf and node reloading:
#t/003_peer.pl .. Dubious, test returned 2 (wstat 512, 0x200)
#No subtests run

Logs regress_log_003_peer and 003_peer_node.log are attached.

With best regards,

-- 
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Commits

  1. Skip TAP test for peer authentication if there are no unix-domain sockets

  2. Add authentication TAP test for peer authentication