git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2955c2b)
Ignore more environment variables in TAP tests
Thu, 3 Jun 2021 02:50:56 +0000 (11:50 +0900)
Thu, 3 Jun 2021 02:50:56 +0000 (11:50 +0900)
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


diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index d6c3eb87232f9fa92f0918a1674fdfc13b8882cf..47d7f31e94ce48dddb7f2d7bbd4896d4c666be36 100644 (file)
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -104,17 +104,38 @@ 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};
- delete $ENV{PG_COLOR};
+ my @envkeys = qw (
+ PGCHANNELBINDING
+ PGCLIENTENCODING
+ PGCONNECT_TIMEOUT
+ PGDATA
+ PGDATABASE
+ PGGSSENCMODE
+ PGGSSLIB
+ PGHOSTADDR
+ PGKRBSRVNAME
+ PGPASSFILE
+ PGPASSWORD
+ PGREQUIREPEER
+ PGREQUIRESSL
+ PGSERVICE
+ PGSERVICEFILE
+ PGSSLCERT
+ PGSSLCRL
+ PGSSLCRLDIR
+ PGSSLKEY
+ PGSSLMAXPROTOCOLVERSION
+ PGSSLMINPROTOCOLVERSION
+ PGSSLMODE
+ PGSSLROOTCERT
+ PGSSLSNI
+ PGTARGETSESSIONATTRS
+ PGUSER
+ PGPORT
+ PGHOST
+ PG_COLOR
+ );
+ delete @ENV{@envkeys};
$ENV{PGAPPNAME} = basename(0ドル);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /