summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-06-03 11:52:03 +0900
committerMichael Paquier <michael@paquier.xyz>2021-06-03 11:52:03 +0900
commita886e2ff2413ee6420b84077f6cb991a5d97b45b (patch)
tree99a567e26372e4ab3b6dd4c3ba5ac3c43ca16e04 /src
parent3eca18522e1908f7a61ab2545bb9238fce4d1ba7 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/test/perl/TestLib.pm35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index cc4fa53a24d..c6c4b99b2ef 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -51,16 +51,31 @@ 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
+ PGUSER
+ PGPORT
+ PGHOST
+ );
+ delete @ENV{@envkeys};
# Must be set early
$windows_os = $Config{osname} eq 'MSWin32' || $Config{osname} eq 'msys';