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

Commit 0d95711

Browse files
committed
Don't clobber test exit code at cleanup in LDAP/Kerberors tests
If the test script die()d before running the first test, the whole test was interpreted as SKIPped rather than failed. The PostgreSQL::Cluster module got this right. Backpatch to all supported versions. Discussion: https://www.postgresql.org/message-id/fb898a70-3a88-4629-88e9-f2375020061d@iki.fi
1 parent 1782571 commit 0d95711

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/test/kerberos/t/001_auth.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,12 @@
180180

181181
END
182182
{
183-
kill 'INT', `cat $kdc_pidfile` if -f $kdc_pidfile;
183+
# take care not to change the script's exit value
184+
my $exit_code = $?;
185+
186+
kill 'INT', `cat $kdc_pidfile` if defined($kdc_pidfile) && -f $kdc_pidfile;
187+
188+
$? = $exit_code;
184189
}
185190

186191
note "setting up PostgreSQL instance";

src/test/ldap/t/001_auth.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@
147147

148148
END
149149
{
150+
# take care not to change the script's exit value
151+
my $exit_code = $?;
152+
150153
kill 'INT', `cat $slapd_pidfile` if -f $slapd_pidfile;
154+
155+
$? = $exit_code;
151156
}
152157

153158
append_to_file($ldap_pwfile, $ldap_rootpw);

0 commit comments

Comments
 (0)