-
Notifications
You must be signed in to change notification settings - Fork 70
/
dcc.t
executable file
·42 lines (25 loc) · 981 Bytes
/
dcc.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl -T
use lib '.'; use lib 't';
use SATest; sa_t_init("dcc");
use constant HAS_DCC => eval { $_ = untaint_cmd("which cdcc"); chomp; -x };
use Test::More;
plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
plan skip_all => "DCC tests disabled" unless conf_bool('run_dcc_tests');
plan skip_all => "DCC executable not found in path" unless HAS_DCC;
plan tests => 4;
diag('Note: Failure may not be an SpamAssassin bug, as DCC tests can fail due to problems with the DCC servers.');
# ---------------------------------------------------------------------------
%patterns = (
q{ spam reported to DCC }, 'dcc report',
);
tstpre ("
loadplugin Mail::SpamAssassin::Plugin::DCC
dcc_timeout 30
");
ok sarun ("-t -D info -r < data/spam/gtubedcc.eml 2>&1", \&patterns_run_cb);
ok_all_patterns();
%patterns = (
q{ Detected as bulk mail by DCC }, 'dcc',
);
ok sarun ("-t < data/spam/gtubedcc.eml", \&patterns_run_cb);
ok_all_patterns();