|
83 | 83 | 'Potentially unsafe test libpq_encryption not enabled in PG_TEST_EXTRA';
|
84 | 84 | }
|
85 | 85 |
|
86 |
| -my $ssl_supported = $ENV{with_ssl} eq 'openssl'; |
| 86 | +# Only run the GSSAPI tests when compiled with GSSAPI support and |
| 87 | +# PG_TEST_EXTRA includes 'kerberos' |
87 | 88 | my $gss_supported = $ENV{with_gssapi} eq 'yes';
|
| 89 | +my $kerberos_enabled = $ENV{PG_TEST_EXTRA} && $ENV{PG_TEST_EXTRA} =~ /\bkerberos\b/; |
| 90 | +my $ssl_supported = $ENV{with_ssl} eq 'openssl'; |
88 | 91 |
|
89 | 92 | ###
|
90 | 93 | ### Prepare test server for GSSAPI and SSL authentication, with a few
|
|
118 | 121 |
|
119 | 122 | my $krb;
|
120 | 123 |
|
121 |
| -if ($gss_supported != 0) |
| 124 | +if ($gss_supported != 0 && $kerberos_enabled != 0) |
122 | 125 | {
|
123 | 126 | note "setting up Kerberos";
|
124 | 127 |
|
@@ -197,7 +200,7 @@ BEGIN
|
197 | 200 |
|
198 | 201 | print $hba qq{
|
199 | 202 | hostgssenc postgres gssuser $servercidr trust
|
200 |
| -} if ($gss_supported != 0); |
| 203 | +} if ($gss_supported != 0 && $kerberos_enabled != 0); |
201 | 204 | close $hba;
|
202 | 205 | $node->reload;
|
203 | 206 |
|
@@ -331,6 +334,7 @@ BEGIN
|
331 | 334 | SKIP:
|
332 | 335 | {
|
333 | 336 | skip "GSSAPI/Kerberos not supported by this build" if $gss_supported == 0;
|
| 337 | + skip "kerberos not enabled in PG_TEST_EXTRA" if $kerberos_enabled == 0; |
334 | 338 |
|
335 | 339 | $krb->create_principal('gssuser', $gssuser_password);
|
336 | 340 | $krb->create_ticket('gssuser', $gssuser_password);
|
@@ -413,7 +417,9 @@ BEGIN
|
413 | 417 | ###
|
414 | 418 | SKIP:
|
415 | 419 | {
|
416 |
| - skip "GSSAPI/Kerberos or SSL not supported by this build" unless ($ssl_supported && $gss_supported); |
| 420 | + skip "SSL not supported by this build" if $ssl_supported == 0; |
| 421 | + skip "GSSAPI/Kerberos not supported by this build" if $gss_supported == 0; |
| 422 | + skip "kerberos not enabled in PG_TEST_EXTRA" if $kerberos_enabled == 0; |
417 | 423 |
|
418 | 424 | # Sanity check that GSSAPI is still enabled from previous test.
|
419 | 425 | connect_test($node, 'user=testuser gssencmode=prefer sslmode=prefer', 'connect, gssaccept, authok -> gss');
|
|
0 commit comments