Small issue with kerberos tests

Started by Maxim Orlov5 months ago2 messages
#1Maxim Orlov
orlovmg@gmail.com
1 attachment(s)

Hi!

Recently, I attempted to run the entire set of pg tests with
PG_TEST_EXTRA="kerberos ..." on NetBSD but encountered
a problem. The kerberos/001_auth and
libpq/005_negotiate_encryption.pl test failed with an incomprehensible
message:
[01:55:38.737](3.698s) # setting up Kerberos
# Running: krb5-config --version
Undefined subroutine &PostgreSQL::Test::Kerberos::BAIL_OUT called at
/home/omg/proj/postgres/src/test/perl/PostgreSQL/Test/Kerberos.pm line 109.

The root cause of the problem was in using
------
$ /usr/bin/krb5-config --version
heimdal 7.8.0
------

...insted of..

------
$ /usr/pkg/bin/krb5-config --version
Kerberos 5 release 1.21.3
------

In other words, PATH must be properly set to use Kerberos 5 version.
But, AFIACS, "use Test::More" is missing in Kerberos.pm resulting
in "Undefined subroutine" error instead of "Heimdal is not supported".

--
Best regards,
Maxim Orlov.

Attachments:

v1-0001-BAIL_OUT-properly-if-krb5-config-is-not-Kerberos-.patchapplication/octet-stream; name=v1-0001-BAIL_OUT-properly-if-krb5-config-is-not-Kerberos-.patchDownload
From ccf39079b94590437fd386c49f6c8d7eb6c0dc1d Mon Sep 17 00:00:00 2001
From: Maxim Orlov <orlovmg@gmail.com>
Date: Mon, 18 Aug 2025 17:55:41 +0300
Subject: [PATCH v1] BAIL_OUT properly if krb5-config is not Kerberos 5

---
 src/test/perl/PostgreSQL/Test/Kerberos.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/test/perl/PostgreSQL/Test/Kerberos.pm b/src/test/perl/PostgreSQL/Test/Kerberos.pm
index b72dd2fbaf4..07a1ea899d0 100644
--- a/src/test/perl/PostgreSQL/Test/Kerberos.pm
+++ b/src/test/perl/PostgreSQL/Test/Kerberos.pm
@@ -9,6 +9,7 @@ package PostgreSQL::Test::Kerberos;
 use strict;
 use warnings FATAL => 'all';
 use PostgreSQL::Test::Utils;
+use Test::More;
 
 our (
 	$krb5_bin_dir, $krb5_sbin_dir, $krb5_config, $kinit,
-- 
2.50.1

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Maxim Orlov (#1)
Re: Small issue with kerberos tests

Maxim Orlov <orlovmg@gmail.com> writes:

Recently, I attempted to run the entire set of pg tests with
PG_TEST_EXTRA="kerberos ..." on NetBSD but encountered
a problem. The kerberos/001_auth and
libpq/005_negotiate_encryption.pl test failed with an incomprehensible
message:
[01:55:38.737](3.698s) # setting up Kerberos
# Running: krb5-config --version
Undefined subroutine &PostgreSQL::Test::Kerberos::BAIL_OUT called at
/home/omg/proj/postgres/src/test/perl/PostgreSQL/Test/Kerberos.pm line 109.

Replicated here on FreeBSD (after hot-wiring the script to not know it
should use /usr/local/bin/krb5-config).

It looks like every other use of BAIL_OUT is in a file that does
have "use Test::More", so this is the only such oversight.
Will push, thanks for the report!

regards, tom lane