mirror of
https://github.com/postgres/postgres.git
synced 2025-05-12 16:21:30 +03:00
Ignore more environment variables in TAP tests
Various environment variables were not getting reset in the TAP tests, which would cause failures depending on the tests or the environment variables involved. For example, PGSSL{MAX,MIN}PROTOCOLVERSION could cause failures in the SSL tests. Even worse, a junk value of PGCLIENTENCODING makes a server startup fail. The list of variables reset is adjusted in each stable branch depending on what is supported. While on it, simplify a bit the code per a suggestion from Andrew Dunstan, using a list of variables instead of doing single deletions. Reviewed-by: Andrew Dunstan, Daniel Gustafsson Discussion: https://postgr.es/m/YLbjjRpucIeZ78VQ@paquier.xyz Backpatch-through: 9.6
This commit is contained in:
parent
dc272157a8
commit
36ac9f6af2
@ -62,16 +62,32 @@ BEGIN
|
||||
delete $ENV{LC_ALL};
|
||||
$ENV{LC_MESSAGES} = 'C';
|
||||
|
||||
delete $ENV{PGCONNECT_TIMEOUT};
|
||||
delete $ENV{PGDATA};
|
||||
delete $ENV{PGDATABASE};
|
||||
delete $ENV{PGHOSTADDR};
|
||||
delete $ENV{PGREQUIRESSL};
|
||||
delete $ENV{PGSERVICE};
|
||||
delete $ENV{PGSSLMODE};
|
||||
delete $ENV{PGUSER};
|
||||
delete $ENV{PGPORT};
|
||||
delete $ENV{PGHOST};
|
||||
my @envkeys = qw (
|
||||
PGCLIENTENCODING
|
||||
PGCONNECT_TIMEOUT
|
||||
PGDATA
|
||||
PGDATABASE
|
||||
PGGSSLIB
|
||||
PGHOSTADDR
|
||||
PGKRBSRVNAME
|
||||
PGPASSFILE
|
||||
PGPASSWORD
|
||||
PGREQUIREPEER
|
||||
PGREQUIRESSL
|
||||
PGSERVICE
|
||||
PGSERVICEFILE
|
||||
PGSSLCERT
|
||||
PGSSLCRL
|
||||
PGSSLCRLDIR
|
||||
PGSSLKEY
|
||||
PGSSLMODE
|
||||
PGSSLROOTCERT
|
||||
PGTARGETSESSIONATTRS
|
||||
PGUSER
|
||||
PGPORT
|
||||
PGHOST
|
||||
);
|
||||
delete @ENV{@envkeys};
|
||||
|
||||
$ENV{PGAPPNAME} = basename($0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user