Re: TAP tests still sensitive to various PG* environment variables - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: TAP tests still sensitive to various PG* environment variables
Date
Msg-id 9c09ca50-931b-b87b-ddac-780415d0df79@dunslane.net
Whole thread Raw
In response to TAP tests still sensitive to various PG* environment variables  (Michael Paquier <michael@paquier.xyz>)
Responses Re: TAP tests still sensitive to various PG* environment variables
List pgsql-hackers
On 6/1/21 9:49 PM, Michael Paquier wrote:
> Hi all,
>
> While looking at a separate issue, I have noticed that TestLib.pm is
> lagging behind in terms of environment variables it had better mask to
> avoid failures:
> https://www.postgresql.org/message-id/YLXjFOV3teAPirmS@paquier.xyz
>
> Once I began playing with the variables not covered yet, and tested
> fancy cases with junk values, I have been able to see various failures
> in the TAP tests, mainly with authentication and SSL.
>
> Attached is a patch to strengthen all that, which I think we'd better
> backpatch.
>
> Any objections to that?



This is a bit gruesome:


    +    delete $ENV{PGCHANNELBINDING};
    +    delete $ENV{PGCLIENTENCODING};
         delete $ENV{PGCONNECT_TIMEOUT};
         delete $ENV{PGDATA};
         delete $ENV{PGDATABASE};
    +    delete $ENV{PGGSSENCMODE};
    +    delete $ENV{PGGSSLIB};
         delete $ENV{PGHOSTADDR};
    +    delete $ENV{PGKRBSRVNAME};
    +    delete $ENV{PGPASSFILE};
    +    delete $ENV{PGPASSWORD};
    +    delete $ENV{PGREQUIREPEER};
         delete $ENV{PGREQUIRESSL};
         delete $ENV{PGSERVICE};
    +    delete $ENV{PGSERVICEFILE};
    +    delete $ENV{PGSSLCERT};
    +    delete $ENV{PGSSLCRL};
    +    delete $ENV{PGSSLCRLDIR};
    +    delete $ENV{PGSSLKEY};
    +    delete $ENV{PGSSLMAXPROTOCOLVERSION};
    +    delete $ENV{PGSSLMINPROTOCOLVERSION};
         delete $ENV{PGSSLMODE};
    +    delete $ENV{PGSSLROOTCERT};
    +    delete $ENV{PGSSLSNI};
         delete $ENV{PGUSER};
         delete $ENV{PGPORT};
         delete $ENV{PGHOST};



Let's change it to something like:


    my @scrubkeys = qw ( PGCHANNELBINDING

       PGCLIENTENCODING PGCONNECT_TIMEOUT PGDATA

       ...

        );

    delete @ENV{@scrubkeys};


cheers


andrew


-- 

Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: security_definer_search_path GUC
Next
From: Andrew Dunstan
Date:
Subject: Re: make world and install-world without docs