Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ebd542b

Browse files
committed
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
1 parent bdd096f commit ebd542b

File tree

1 file changed

+28
-11
lines changed

1 file changed

+28
-11
lines changed

src/test/perl/TestLib.pm

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,34 @@ BEGIN
6363
delete $ENV{LC_ALL};
6464
$ENV{LC_MESSAGES} = 'C';
6565

66-
delete $ENV{PGCONNECT_TIMEOUT};
67-
delete $ENV{PGDATA};
68-
delete $ENV{PGDATABASE};
69-
delete $ENV{PGHOSTADDR};
70-
delete $ENV{PGREQUIRESSL};
71-
delete $ENV{PGSERVICE};
72-
delete $ENV{PGSSLMODE};
73-
delete $ENV{PGUSER};
74-
delete $ENV{PGPORT};
75-
delete $ENV{PGHOST};
76-
delete $ENV{PG_COLOR};
66+
my @envkeys = qw (
67+
PGCLIENTENCODING
68+
PGCONNECT_TIMEOUT
69+
PGDATA
70+
PGDATABASE
71+
PGGSSENCMODE
72+
PGGSSLIB
73+
PGHOSTADDR
74+
PGKRBSRVNAME
75+
PGPASSFILE
76+
PGPASSWORD
77+
PGREQUIREPEER
78+
PGREQUIRESSL
79+
PGSERVICE
80+
PGSERVICEFILE
81+
PGSSLCERT
82+
PGSSLCRL
83+
PGSSLCRLDIR
84+
PGSSLKEY
85+
PGSSLMODE
86+
PGSSLROOTCERT
87+
PGTARGETSESSIONATTRS
88+
PGUSER
89+
PGPORT
90+
PGHOST
91+
PG_COLOR
92+
);
93+
delete @ENV{@envkeys};
7794

7895
$ENV{PGAPPNAME} = basename($0);
7996

0 commit comments

Comments
 (0)