~ubuntu-branches/ubuntu/natty/spamassassin/natty

« back to all changes in this revision

Viewing changes to t/uribl.t

  • Committer: Package Import Robot
  • Author(s): Noah Meyerhans
  • Date: 2010-03-21 23:20:31 UTC
  • mfrom: (0.4.1) (1.4.1) (29.2.1 maverick)
  • Revision ID: package-import@ubuntu.com-20100321232031-ryqjxh9cx27epnka
Tags: 3.3.1-1
* New upstream version.
* Update several patches now that bugfixes have been incorporated
  upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
use SATest; sa_t_init("uribl");
5
5
 
6
6
use constant TEST_ENABLED => conf_bool('run_net_tests') && conf_bool('run_long_tests');
7
 
use constant HAS_NET_DNS => eval { require Net::DNS; };
8
 
# bug 3806:
9
 
# Do not run this test with version of Sys::Hostname::Long older than 1.4
10
 
# on non-Linux unices as root, due to a bug in Sys::Hostname::Long
11
 
# (which is used by Net::DNS)
12
 
use constant IS_LINUX   => $^O eq 'linux';
13
 
use constant IS_WINDOWS => ($^O =~ /^(mswin|dos|os2)/oi);
14
 
use constant AM_ROOT    => $< == 0;
15
 
use constant HAS_SAFE_HOSTNAME =>
16
 
  eval { require Sys::Hostname::Long; Sys::Hostname::Long->VERSION(1.4) };
17
 
 
18
 
use constant DO_RUN =>
19
 
  TEST_ENABLED && HAS_NET_DNS &&
20
 
  (HAS_SAFE_HOSTNAME || !AM_ROOT || IS_LINUX || IS_WINDOWS);
21
 
 
 
7
use constant DO_RUN => TEST_ENABLED && can_use_net_dns_safely();
22
8
use Test;
23
9
 
24
10
BEGIN {
25
 
  plan tests => (DO_RUN ? 5 : 0),
 
11
  plan tests => (DO_RUN ? 6 : 0),
26
12
};
27
13
 
28
14
exit unless (DO_RUN);
34
20
 q{ X_URIBL_B } => 'B',
35
21
 q{ X_URIBL_NS } => 'NS',
36
22
 q{ X_URIBL_FULL_NS } => 'FULL_NS',
 
23
 q{ X_URIBL_DOMSONLY } => 'X_URIBL_DOMSONLY',
37
24
);
38
25
 
39
26
tstlocalrules(q{
56
43
  body       X_URIBL_FULL_NS  eval:check_uridnsbl('X_URIBL_FULL_NS')
57
44
  tflags     X_URIBL_FULL_NS  net
58
45
 
 
46
  urirhssub  X_URIBL_DOMSONLY  dnsbltest.spamassassin.org.    A 2
 
47
  body       X_URIBL_DOMSONLY  eval:check_uridnsbl('X_URIBL_DOMSONLY')
 
48
  tflags     X_URIBL_DOMSONLY  net domains_only
 
49
 
59
50
  add_header all RBL _RBL_
60
51
 
61
52
});