X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FTest%2FGnuPG.pm;h=e5a08b75a1072fc4a5674508764eb5ee083c99e3;hp=6cebb775bccc5a63a928d8cf845ef44a47616202;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=6587f6ba7d047ddc1686c080090afe7d53365bd4 diff --git a/rt/lib/RT/Test/GnuPG.pm b/rt/lib/RT/Test/GnuPG.pm index 6cebb775b..e5a08b75a 100644 --- a/rt/lib/RT/Test/GnuPG.pm +++ b/rt/lib/RT/Test/GnuPG.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -48,6 +48,7 @@ package RT::Test::GnuPG; use strict; +use warnings; use Test::More; use base qw(RT::Test); use File::Temp qw(tempdir); @@ -64,12 +65,13 @@ sub import { my $t = $class->builder; $t->plan( skip_all => 'GnuPG required.' ) - unless eval { require GnuPG::Interface; 1 }; + unless GnuPG::Interface->require; $t->plan( skip_all => 'gpg executable is required.' ) unless RT::Test->find_executable('gpg'); - require RT::Crypt::GnuPG; $class->SUPER::import(%args); + return $class->export_to_level(1) + if $^C; RT::Test::diag "GnuPG --homedir " . RT->Config->Get('GnuPGOptions')->{'homedir'}; @@ -104,7 +106,7 @@ Set(\%GnuPG, ( OutgoingMessagesFormat => 'RFC', )); Set(\%GnuPGOptions => \%{ $dumped_gnupg_options }); -Set(\@MailPlugins => qw(Auth::MailFrom Auth::GnuPG)); +Set(\@MailPlugins => qw(Auth::MailFrom Auth::Crypt)); }; } @@ -164,7 +166,7 @@ sub update_ticket { $m->click('SubmitTicket'); is $m->status, 200, "request successful"; - $m->content_contains("Message recorded", 'Message recorded') or diag $m->content; + $m->content_contains("Correspondence added", 'Correspondence added') or diag $m->content; my @mail = RT::Test->fetch_caught_mails; @@ -228,7 +230,7 @@ sub cleanup_headers { # strip id from subject to create new ticket $mail =~ s/^(Subject:)\s*\[.*?\s+#\d+\]\s*/$1 /m; # strip several headers - foreach my $field ( qw(Message-ID X-RT-Original-Encoding RT-Originator RT-Ticket X-RT-Loop-Prevention) ) { + foreach my $field ( qw(Message-ID RT-Originator RT-Ticket X-RT-Loop-Prevention) ) { $mail =~ s/^$field:.*?\n(?! |\t)//gmsi; } return $mail; @@ -273,7 +275,7 @@ sub send_email_and_check_transaction { "RT's outgoing mail looks not signed"; } elsif ( $type eq 'signed' ) { - is $msg->GetHeader('X-RT-Privacy'), 'PGP', + is $msg->GetHeader('X-RT-Privacy'), 'GnuPG', "RT's outgoing mail has crypto"; is $msg->GetHeader('X-RT-Incoming-Encryption'), 'Not encrypted', "RT's outgoing mail looks not encrypted"; @@ -282,7 +284,7 @@ sub send_email_and_check_transaction { "RT's outgoing mail looks signed"; } elsif ( $type eq 'encrypted' ) { - is $msg->GetHeader('X-RT-Privacy'), 'PGP', + is $msg->GetHeader('X-RT-Privacy'), 'GnuPG', "RT's outgoing mail has crypto"; is $msg->GetHeader('X-RT-Incoming-Encryption'), 'Success', "RT's outgoing mail looks encrypted"; @@ -291,7 +293,7 @@ sub send_email_and_check_transaction { } elsif ( $type eq 'signed_encrypted' ) { - is $msg->GetHeader('X-RT-Privacy'), 'PGP', + is $msg->GetHeader('X-RT-Privacy'), 'GnuPG', "RT's outgoing mail has crypto"; is $msg->GetHeader('X-RT-Incoming-Encryption'), 'Success', "RT's outgoing mail looks encrypted";