aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-07 20:21:27 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-04-07 20:21:27 +0300
commita475a2fa3bc9c68eaa2aeda28d6d86529eda4673 (patch)
tree500eb225aa8a7a66558c230066a0901b8b8d8e33 /src
parente13b586d7c989147afd910c6997659a8412a8b84 (diff)
downloadpostgresql-a475a2fa3bc9c68eaa2aeda28d6d86529eda4673.tar.gz
postgresql-a475a2fa3bc9c68eaa2aeda28d6d86529eda4673.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/test/kerberos/t/001_auth.pl5
-rw-r--r--src/test/ldap/LdapServer.pm5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index e51e87d0a2e..ec311bfed8c 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -203,7 +203,12 @@ system_or_bail $krb5kdc, '-P', $kdc_pidfile;
END
{
+ # take care not to change the script's exit value
+ my $exit_code = $?;
+
kill 'INT', `cat $kdc_pidfile` if defined($kdc_pidfile) && -f $kdc_pidfile;
+
+ $? = $exit_code;
}
note "setting up PostgreSQL instance";
diff --git a/src/test/ldap/LdapServer.pm b/src/test/ldap/LdapServer.pm
index 91cd9e37622..3866a56e0a6 100644
--- a/src/test/ldap/LdapServer.pm
+++ b/src/test/ldap/LdapServer.pm
@@ -145,6 +145,9 @@ INIT
END
{
+ # take care not to change the script's exit value
+ my $exit_code = $?;
+
foreach my $server (@servers)
{
next unless -f $server->{pidfile};
@@ -152,6 +155,8 @@ END
chomp $pid;
kill 'INT', $pid;
}
+
+ $? = $exit_code;
}
=pod