[Rt-commit] rt branch 5.0/update-tests-for-gpg-2.4 created. rt-5.0.5-200-gcffe88b30f

BPS Git Server git at git.bestpractical.com
Wed Apr 3 17:55:23 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/update-tests-for-gpg-2.4 has been created
        at  cffe88b30f559c62a68c102446539ef565a19a3a (commit)

- Log -----------------------------------------------------------------
commit cffe88b30f559c62a68c102446539ef565a19a3a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 3 13:53:45 2024 -0400

    Update tests for new warning messages in gpg 2.4+

diff --git a/t/security/CVE-2012-4735-incoming-encryption-header.t b/t/security/CVE-2012-4735-incoming-encryption-header.t
index e067ff1136..00d8ce0ff1 100644
--- a/t/security/CVE-2012-4735-incoming-encryption-header.t
+++ b/t/security/CVE-2012-4735-incoming-encryption-header.t
@@ -54,13 +54,19 @@ This was _totally_ encrypted.
 EOF
 
     my ($status, $id);
-    warnings_like {
+    {
+        my @warnings;
+        local $SIG{__WARN__} = sub { push @warnings, @_ };
         ($status, $id) = RT::Test->send_via_mailgate($mail);
         ok $id, "created a ticket";
-    } [qr/(?:keyring|keybox) .* created/,
-       qr/Failure during GnuPG data: No data has been found\. The reason is 'Invalid packet found'/,
-       qr/Failure during GnuPG data: No data has been found\. The reason is 'No armored data'/,
-   ];
+
+        like($warnings[0], qr/(?:keyring|keybox) .* created/, 'GnuPG warning');
+        like($warnings[1], qr/Failure during GnuPG data: No data has been found\. The reason is 'Invalid packet found'/, 'GnuPG warning');
+        like($warnings[2], qr/Failure during GnuPG data: No data has been found\. The reason is 'No armored data'/, 'GnuPG warning');
+        if ( $warnings[3] ) {
+            like($warnings[3], qr/Failure during GnuPG gpg-exit: Failed to gpg-exit/, 'GnuPG warning');
+        }
+    }
 
     my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Load( $id );

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list