Fix some issues with SSL and Kerberos tests
authorMichael Paquier <[email protected]>
Tue, 6 Apr 2021 04:23:57 +0000 (13:23 +0900)
committerMichael Paquier <[email protected]>
Tue, 6 Apr 2021 04:23:57 +0000 (13:23 +0900)
The recent refactoring done in c50624c accidentally broke a portion of
the kerberos tests checking after a query, so add its functionality
back.  Some inactive SSL tests had their arguments in an incorrect
order, which would cause them to fail if they were to run.

Author: Jacob Champion
Discussion: https://postgr.es/m/4f5b0b3dc0b6fe9ae6a34886b4d4000f61eb567e[email protected]

src/test/kerberos/t/001_auth.pl
src/test/ssl/t/001_ssltests.pl

index de52a667854cd1c5e7e6e3fddc4732a138c5ff63..8db18294608a712c3a25ba9c269dad2f9f4d0081 100644 (file)
@@ -20,7 +20,7 @@ use Time::HiRes qw(usleep);
 
 if ($ENV{with_gssapi} eq 'yes')
 {
-   plan tests => 30;
+   plan tests => 32;
 }
 else
 {
@@ -196,7 +196,7 @@ sub test_access
        $node->connect_ok(
            $connstr, $test_name,
            sql             => $query,
-           expected_stdout => qr/t/);
+           expected_stdout => qr/^t$/);
    }
    else
    {
@@ -227,9 +227,10 @@ sub test_query
    my $connstr = $node->connstr('postgres')
      . " user=$role host=$host hostaddr=$hostaddr $gssencmode";
 
-   my ($stdoutres, $stderrres);
-
-   $node->connect_ok($connstr, $test_name, $query, $expected);
+   $node->connect_ok(
+       $connstr, $test_name,
+       sql             => $query,
+       expected_stdout => $expected);
    return;
 }
 
index 21865ac30fc7fa790e0caa2b360feb8590dda035..0decbe71774f377cc6efb2fbdc51aed053f997f5 100644 (file)
@@ -459,17 +459,17 @@ TODO:
    # correct client cert in encrypted PEM with empty password
    $node->connect_fails(
        "$common_connstr user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key sslpassword=''",
+       "certificate authorization fails with correct client cert and empty password in encrypted PEM format",
        expected_stderr =>
-         qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!,
-       "certificate authorization fails with correct client cert and empty password in encrypted PEM format"
+         qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!
    );
 
    # correct client cert in encrypted PEM with no password
    $node->connect_fails(
        "$common_connstr user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client-encrypted-pem_tmp.key",
+       "certificate authorization fails with correct client cert and no password in encrypted PEM format",
        expected_stderr =>
-         qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!,
-       "certificate authorization fails with correct client cert and no password in encrypted PEM format"
+         qr!\Qprivate key file "ssl/client-encrypted-pem_tmp.key": processing error\E!
    );
 
 }