Follow-up fixes for "Make all Perl warnings fatal"
authorPeter Eisentraut <peter@eisentraut.org>
Fri, 29 Dec 2023 22:54:40 +0000 (23:54 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Fri, 29 Dec 2023 22:54:40 +0000 (23:54 +0100)
Mostly, we need to check whether $ENV{PG_TEST_EXTRA} is set before
doing regular expression matches against it.

src/interfaces/libpq/t/004_load_balance_dns.pl
src/test/kerberos/t/001_auth.pl
src/test/ldap/t/001_auth.pl
src/test/ldap/t/002_bindpasswd.pl
src/test/modules/ldap_password_func/t/001_mutated_bindpasswd.pl
src/test/modules/xid_wraparound/t/001_emergency_vacuum.pl
src/test/modules/xid_wraparound/t/002_limits.pl
src/test/modules/xid_wraparound/t/003_wraparounds.pl
src/test/ssl/t/001_ssltests.pl
src/test/ssl/t/002_scram.pl
src/test/ssl/t/003_sslinfo.pl

index 81cf628ac7c5936bcba3458f7429853311b214f0..49f1f5f331d950aba6826a97345b48af020100e1 100644 (file)
@@ -6,7 +6,7 @@ use PostgreSQL::Test::Utils;
 use PostgreSQL::Test::Cluster;
 use Test::More;
 
-if ($ENV{PG_TEST_EXTRA} !~ /\bload_balance\b/)
+if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bload_balance\b/)
 {
        plan skip_all =>
          'Potentially unsafe test load_balance not enabled in PG_TEST_EXTRA';
index e9ceb712f5b83cf2fda9b9e7f4744d89a301b215..5c7f75439685ba1dc9207c9820bf6eb536682428 100644 (file)
@@ -28,7 +28,7 @@ if ($ENV{with_gssapi} ne 'yes')
 {
        plan skip_all => 'GSSAPI/Kerberos not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bkerberos\b/)
 {
        plan skip_all =>
          'Potentially unsafe test GSSAPI/Kerberos not enabled in PG_TEST_EXTRA';
@@ -203,7 +203,7 @@ system_or_bail $krb5kdc, '-P', $kdc_pidfile;
 
 END
 {
-       kill 'INT', `cat $kdc_pidfile` if -f $kdc_pidfile;
+       kill 'INT', `cat $kdc_pidfile` if defined($kdc_pidfile) && -f $kdc_pidfile;
 }
 
 note "setting up PostgreSQL instance";
index 5e569c4db969c69e938cdd905b391667ffe80156..2648ccf2215ce7d38599bf2f7325d7494010e0bb 100644 (file)
@@ -18,7 +18,7 @@ if ($ENV{with_ldap} ne 'yes')
 {
        plan skip_all => 'LDAP not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
 {
        plan skip_all =>
          'Potentially unsafe test LDAP not enabled in PG_TEST_EXTRA';
index 204ed390590fb64b839d93d66a57cadbbdf31c16..47d59b01ab7e1977467b48db2c76a99e8142256c 100644 (file)
@@ -18,7 +18,7 @@ if ($ENV{with_ldap} ne 'yes')
 {
        plan skip_all => 'LDAP not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
 {
        plan skip_all =>
          'Potentially unsafe test LDAP not enabled in PG_TEST_EXTRA';
index b7ac65091ac4cc6dbe97dc3960bc611c5eee6bb0..42c9aa8ae2f59a054232c24c8d74e0fd790a809f 100644 (file)
@@ -20,7 +20,7 @@ if ($ENV{with_ldap} ne 'yes')
 {
        plan skip_all => 'LDAP not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bldap\b/)
 {
        plan skip_all =>
          'Potentially unsafe test LDAP not enabled in PG_TEST_EXTRA';
index 4121154a53ce3c673ee3aa034ece0baa59f87ee0..245f3e27d6b18e889cb995757961850ad4e1e49c 100644 (file)
@@ -7,7 +7,7 @@ use PostgreSQL::Test::Cluster;
 use PostgreSQL::Test::Utils;
 use Test::More;
 
-if ($ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
+if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
 {
        plan skip_all => "test xid_wraparound not enabled in PG_TEST_EXTRA";
 }
index 7750473bc58b4c85fe1e75b5fb7ab47eb40a7f32..d97917c25f438c9d4cccced374f7084f76fb0e3e 100644 (file)
@@ -14,7 +14,7 @@ use PostgreSQL::Test::Utils;
 use Test::More;
 use Time::HiRes qw(usleep);
 
-if ($ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
+if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
 {
        plan skip_all => "test xid_wraparound not enabled in PG_TEST_EXTRA";
 }
index 283d1532c2a546fd9bd4e0c4390cdd874df55998..974cf90d304c9c1ef6d85774eaadce39210abb6d 100644 (file)
@@ -10,7 +10,7 @@ use PostgreSQL::Test::Utils;
 use Test::More;
 use Time::HiRes qw(usleep);
 
-if ($ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
+if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bxid_wraparound\b/)
 {
        plan skip_all => "test xid_wraparound not enabled in PG_TEST_EXTRA";
 }
index 4f2864da935d9c4b96bd80612764c22908ca901b..885f39cd8adee7f7e6b22e702b0de9a616090a29 100644 (file)
@@ -17,7 +17,7 @@ if ($ENV{with_ssl} ne 'openssl')
 {
        plan skip_all => 'OpenSSL not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
 {
        plan skip_all =>
          'Potentially unsafe test SSL not enabled in PG_TEST_EXTRA';
index 807b211f9845f6fa9f05d14d36944ea98e91a7da..ecd5c67c80c8976cd8e8b43e752a44227ad22609 100644 (file)
@@ -20,7 +20,7 @@ if ($ENV{with_ssl} ne 'openssl')
 {
        plan skip_all => 'OpenSSL not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
 {
        plan skip_all =>
          'Potentially unsafe test SSL not enabled in PG_TEST_EXTRA';
index 866fe5ad2c4499515dee1ace728284ea3e7df4f7..5c7442aa2b89c01eb118eda35bb4a816e6e2828f 100644 (file)
@@ -18,7 +18,7 @@ if ($ENV{with_ssl} ne 'openssl')
 {
        plan skip_all => 'OpenSSL not supported by this build';
 }
-elsif ($ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
+elsif (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\bssl\b/)
 {
        plan skip_all =>
          'Potentially unsafe test SSL not enabled in PG_TEST_EXTRA';