View | Details | Raw Unified | Return to bug 5574
Collapse All | Expand All

(-)MANIFEST (+1 lines)
Lines 504-506 Link Here
504
t/root_spamd_x_u.t
504
t/root_spamd_x_u.t
505
t/spamc_x_E_R.t
505
t/spamc_x_E_R.t
506
t/spamc_x_e.t
506
t/spamc_x_e.t
507
t/root_spamd_u.t
(-)t/root_spamd_u.t (+42 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# run with:   sudo prove -v t/root_spamd*
4
5
use lib '.'; use lib 't';
6
use SATest; sa_t_init("root_spamd_u");
7
use Test;
8
9
use constant TEST_ENABLED => conf_bool('run_root_tests');
10
use constant IS_ROOT => eval { ($> == 0); };
11
use constant RUN_TESTS => (TEST_ENABLED && IS_ROOT);
12
13
BEGIN { plan tests => (RUN_TESTS ? 14 : 0) };
14
exit unless RUN_TESTS;
15
16
# ---------------------------------------------------------------------------
17
18
%patterns = (
19
20
q{ Return-Path: sb55sb55@yahoo.com}, 'firstline',
21
q{ Subject: There yours for FREE!}, 'subj',
22
q{ X-Spam-Status: Yes, score=}, 'status',
23
q{ X-Spam-Flag: YES}, 'flag',
24
q{ X-Spam-Level: **********}, 'stars',
25
q{ TEST_ENDSNUMS}, 'endsinnums',
26
q{ TEST_NOREALNAME}, 'noreal',
27
q{ This must be the very last line}, 'lastline',
28
29
);
30
31
# run spamc as unpriv uid
32
$spamc = "sudo -u nobody $spamc";
33
34
ok(start_spamd("-L -u nobody"));
35
36
$SIG{ALRM} = sub { die "timed out"; };
37
alarm 10;
38
ok(spamcrun("< data/spam/001", \&patterns_run_cb));
39
alarm 0;
40
ok_all_patterns();
41
42
ok(stop_spamd());
0
  + *
43
  + *

Return to bug 5574