Working toward functional virus/clamdscan tests.
This commit is contained in:
parent
9faa1e1903
commit
8344bf8439
@ -17,9 +17,10 @@ WriteMakefile(
|
|||||||
'Net::IP' => 0,
|
'Net::IP' => 0,
|
||||||
'Time::HiRes' => 0,
|
'Time::HiRes' => 0,
|
||||||
'IO::Socket::SSL' => 0,
|
'IO::Socket::SSL' => 0,
|
||||||
|
'ClamAV::Client' => 0, # virus/clamdscan
|
||||||
# Dev/Test modules
|
# Dev/Test modules
|
||||||
'Test::More' => 0,
|
'Test::More' => 0,
|
||||||
'Test::Output' => 0,
|
'Test::Output' => 0,
|
||||||
# modules for specific features
|
# modules for specific features
|
||||||
'Mail::DKIM' => 0,
|
'Mail::DKIM' => 0,
|
||||||
'File::Tail' => 0, # log/summarize, log/watch
|
'File::Tail' => 0, # log/summarize, log/watch
|
||||||
@ -49,8 +50,8 @@ sub MY::postamble {
|
|||||||
qq[
|
qq[
|
||||||
testcover :
|
testcover :
|
||||||
\t cover -delete && \\
|
\t cover -delete && \\
|
||||||
HARNESS_PERL_SWITCHES=-MDevel::Cover \$(MAKE) test && \\
|
HARNESS_PERL_SWITCHES=-MDevel::Cover \$(MAKE) test && \\
|
||||||
cover
|
cover
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,11 +8,13 @@ use Qpsmtpd::Constants;
|
|||||||
sub register_tests {
|
sub register_tests {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
eval 'use ClamAV::Client'; ## no critic (Stringy)
|
SKIP: {
|
||||||
if ( ! $@ ) {
|
eval 'use ClamAV::Client'; ## no critic (Stringy)
|
||||||
|
skip "Could not load ClamAV::Client", 4
|
||||||
|
if $@;
|
||||||
$self->register_test('test_register', 3);
|
$self->register_test('test_register', 3);
|
||||||
$self->register_test('test_get_clamd', 1);
|
$self->register_test('test_get_clamd', 1);
|
||||||
};
|
}
|
||||||
$self->register_test('test_err_and_return', 2);
|
$self->register_test('test_err_and_return', 2);
|
||||||
$self->register_test('test_get_filename', 1);
|
$self->register_test('test_get_filename', 1);
|
||||||
$self->register_test('test_set_permission', 1);
|
$self->register_test('test_set_permission', 1);
|
||||||
@ -24,8 +26,8 @@ sub test_register {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
ok( $self->{_args}{deny_viruses} eq 'yes', "deny_viruses");
|
ok( $self->{_args}{deny_viruses} eq 'yes', "deny_viruses");
|
||||||
ok( $self->{_args}{max_size} == 128, "max_size");
|
ok( $self->{_args}{max_size} == 1024, "max_size");
|
||||||
ok( $self->{_args}{scan_all} == 0, "scan_all");
|
ok( $self->{_args}{scan_all} == 1, "scan_all");
|
||||||
};
|
};
|
||||||
|
|
||||||
sub test_err_and_return {
|
sub test_err_and_return {
|
||||||
@ -74,16 +76,10 @@ sub test_is_too_big {
|
|||||||
|
|
||||||
sub test_is_not_multipart {
|
sub test_is_not_multipart {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $tran = shift || $self->qp->transaction();
|
my $tran = $self->qp->transaction();
|
||||||
|
|
||||||
ok( $self->is_not_multipart(), "not_multipart" );
|
ok( $self->is_not_multipart(), "not_multipart" );
|
||||||
|
$tran->header->add('Content-Type', 'multipart/alternative; boundary="Jx3Wbb8BMHsO=_?:"');
|
||||||
if ( $tran->header ) {
|
ok( ! $self->is_not_multipart(), "not_multipart" );
|
||||||
$tran->header->add('Content-Type', 'multipart/alternative; boundary="Jx3Wbb8BMHsO=_?:"');
|
|
||||||
ok( ! $self->is_not_multipart(), "not_multipart" );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ok( 1 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user