Re: pgsql: Add TAP tests for contrib/sslinfo

From: Andres Freund <andres(at)anarazel(dot)de>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers(at)lists(dot)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: pgsql: Add TAP tests for contrib/sslinfo
Date: 2021-12-02 21:21:12
Message-ID: 20211202212112.ttklesxps5eqb533@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi,

On 2021-12-02 22:07:17 +0100, Daniel Gustafsson wrote:
> > On 2 Dec 2021, at 20:51, Andres Freund <andres(at)anarazel(dot)de> wrote:
> >
> > Hi,
> >
> > On 2021-12-01 20:49:21 +0100, Daniel Gustafsson wrote:
> >> Looks like perl2host() was the missing piece, fairywren turned green with
> >> commit c3b34a0ff4.
> >
> > Does that work with MSVC? I rebased my CI patch ontop of this, and it fails on
> > windows:
> > https://cirrus-ci.com/task/6093088335593472?logs=ssl_test#L5
>
> I was under the impression that it did, but it seems that my Appveyor scripts
> had a bug which hid that =( Sorry for that.

I really want to get the CI stuff merged so stuff like this is easier going
forward... FWIW, I have a new colleague working on installing more of the
optional dependencies for windows - but we can add those later.

> This seems to be another case of Perl being perfectly happy to copy and manage
> the files, but Postgres not being able to read them since we'd otherwise die()
> a lot sooner. The error message is the same as when the msys directory wasn't
> fixed with perl2host:

> [04:05:47.204] # got: 'psql: error: connection to server at "127.0.0.1", port 59360 failed: certificate present, but not private key file "C:cirrussrctestssltmp_checktmp_test_AIn7/client.key"
>
> Looking at other tests, we pass a tempdir() to postgres just fine, so that
> clearly works. The one difference here is that the filename is added with
> "/client.key", so I have a feeling this is a delimiter issue where Windows
> expects a backslash? In src/test/recovery/t/025_stuck_on_old_timeline.pl we do
> the following, which IMO would be neat if perl2host (or a similar function)
> would do for us:

Hm. Isn't the problem that we are not adding enough of the other path
delimiters? The /client.key seems fine, the problem is that all the other
delimiters were swallowed. Or is that what you mean?

I think the difference might be that the most of the other tests do not pass
such paths to postgres via postgresql.conf (based on a *very* cursory grep). I
assume the guc machinery treats the \ as an escape, and that's why you're
seeing c:cirrussrc... instead of c:\cirrus\src\...

> my $archivedir_primary = $node_primary->archive_dir;
> $archivedir_primary =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
> $node_primary->append_conf(
> 'postgresql.conf', qq(
> archive_command = '"$perlbin" "$FindBin::RealBin/cp_history_files" "%p" "$archivedir_primary/%f"'
> wal_keep_size=128MB
> ));
>
> I'll fix it, or revert if I can't make it work. Sorry for the breakage.

And this works because it uses *forward* slashes instad of backward slashes,
which then do not get escaped by the guc machinery.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-12-02 22:15:34 pgsql: On Windows, close the client socket explicitly during backend sh
Previous Message Andres Freund 2021-12-02 21:13:10 Re: pgsql: Add TAP tests for contrib/sslinfo