Skip to content

Commit 8279f68

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/[email protected] Backpatch-through: 9.6
1 parent 2955c2b commit 8279f68

File tree

1 file changed

+32
-11
lines changed

1 file changed

+32
-11
lines changed

Diff for: src/test/perl/TestLib.pm

+32-11
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,38 @@ BEGIN
104104
delete $ENV{LC_ALL};
105105
$ENV{LC_MESSAGES} = 'C';
106106

107-
delete $ENV{PGCONNECT_TIMEOUT};
108-
delete $ENV{PGDATA};
109-
delete $ENV{PGDATABASE};
110-
delete $ENV{PGHOSTADDR};
111-
delete $ENV{PGREQUIRESSL};
112-
delete $ENV{PGSERVICE};
113-
delete $ENV{PGSSLMODE};
114-
delete $ENV{PGUSER};
115-
delete $ENV{PGPORT};
116-
delete $ENV{PGHOST};
117-
delete $ENV{PG_COLOR};
107+
my @envkeys = qw (
108+
PGCHANNELBINDING
109+
PGCLIENTENCODING
110+
PGCONNECT_TIMEOUT
111+
PGDATA
112+
PGDATABASE
113+
PGGSSENCMODE
114+
PGGSSLIB
115+
PGHOSTADDR
116+
PGKRBSRVNAME
117+
PGPASSFILE
118+
PGPASSWORD
119+
PGREQUIREPEER
120+
PGREQUIRESSL
121+
PGSERVICE
122+
PGSERVICEFILE
123+
PGSSLCERT
124+
PGSSLCRL
125+
PGSSLCRLDIR
126+
PGSSLKEY
127+
PGSSLMAXPROTOCOLVERSION
128+
PGSSLMINPROTOCOLVERSION
129+
PGSSLMODE
130+
PGSSLROOTCERT
131+
PGSSLSNI
132+
PGTARGETSESSIONATTRS
133+
PGUSER
134+
PGPORT
135+
PGHOST
136+
PG_COLOR
137+
);
138+
delete @ENV{@envkeys};
118139

119140
$ENV{PGAPPNAME} = basename($0);
120141

0 commit comments

Comments
 (0)