Commit f3dfbc69 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Adding tests for 96614ad6

parent 96614ad6
......@@ -30,6 +30,7 @@ check_SCRIPTS = \
t/02_Sympa_DatabaseManager.t \
t/Language.t \
t/LockedFile.t \
t/Message_smime.t \
t/Regexps.t \
t/compile_modules.t \
t/compile_executables.t \
......@@ -59,6 +60,8 @@ check_DATA = \
t/data/sympa.conf \
t/data/sympa.sqlite \
t/data/etc/auth.conf \
t/samples/signed.eml \
t/samples/unsigned.eml \
xt/perlcriticrc
noinst_SCRIPTS = \
xt/critic.t \
......
# -*- indent-tabs-mode: nil; -*-
# vim:ft=perl:et:sw=4
# $Id$
use strict;
use warnings;
use English qw(-no_match_vars);
use Test::More;
use Sympa::Log;
use Sympa::Message;
%Conf::Conf = (
sender_headers => 'From',
);
Sympa::Log->instance->{log_to_stderr} = 'err';
# ToDo: smime_encrypt()
# ToDo: smime_decrypt()
# ToDo: smime_sign()
# ToDo: check_smime_signature()
# is_signed()
is test_is_signed('t/samples/unsigned.eml'), 0, 'never signed';
is test_is_signed('t/samples/signed.eml'), 1, 'multipart/signed S/MIME';
#is test_is_signed('t/samples/signed-pkcs7.eml'), 1, 'PKCS#7 S/MIME';
#is test_is_signed('t/samples/signed-pgp.eml'), 0, 'multipart/signed PGP/MIME';
#is test_is_signed('t/samples/signed-pgp-inline.eml'), 0, 'PGP inline';
done_testing();
sub test_is_signed {
my $path = shift;
open my $fh, '<', $path or die $ERRNO;
my $str = do { local $RS; <$fh> };
close $fh;
my $message = Sympa::Message->new($str, context => '*');
return $message->is_signed;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment