summaryrefslogtreecommitdiff
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:23:22 +0300
commit3d5a9bb8df65ac6446ae5ad769c0adc5f332c164 (patch)
tree261c0e8c70491ad56dc593aae9d4719a2901e699 /src
parent1843a27efb56eee2f679a246c47bd56ad891592c (diff)
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.pl7
-rw-r--r--src/test/ldap/t/001_auth.pl5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index 5d7add9d9e7..c27b732675d 100644
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -188,7 +188,12 @@ system_or_bail $krb5kdc, '-P', $kdc_pidfile;
END
{
- kill 'INT', `cat $kdc_pidfile` if -f $kdc_pidfile;
+ # 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/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index 8138aba1ed2..67dfa7ecce2 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -150,7 +150,12 @@ system_or_bail $slapd, '-f', $slapd_conf,'-s0', '-h', "$ldap_url $ldaps_url";
END
{
+ # take care not to change the script's exit value
+ my $exit_code = $?;
+
kill 'INT', `cat $slapd_pidfile` if -f $slapd_pidfile;
+
+ $? = $exit_code;
}
append_to_file($ldap_pwfile, $ldap_rootpw);