~ubuntu-branches/ubuntu/utopic/spamassassin/utopic-proposed

« back to all changes in this revision

Viewing changes to t/spamd_kill_restart_rr.t

  • Committer: Bazaar Package Importer
  • Author(s): Noah Meyerhans
  • Date: 2010-01-26 22:53:12 UTC
  • mfrom: (1.1.13 upstream) (5.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100126225312-wkftb10idc1kz2aq
Tags: 3.3.0-1
* New upstream version.
* Switch to dpkg-source 3.0 (quilt) format

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
use lib '.'; use lib 't';
4
4
use SATest; sa_t_init("spamd_kill_restart_rr");
5
 
use constant TEST_ENABLED => !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
 
5
 
 
6
use constant TEST_ENABLED => conf_bool('run_long_tests') &&
 
7
                                !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
6
8
 
7
9
use Test; BEGIN { plan tests => (TEST_ENABLED? 93 : 0) };
8
10
 
15
17
my $pid_file = "log/spamd.pid";
16
18
my($pid1, $pid2);
17
19
 
 
20
tstlocalrules("
 
21
      use_auto_whitelist 0
 
22
  ");
 
23
 
18
24
dbgprint "Starting spamd...\n";
19
25
start_spamd("-L --round-robin -r ${pid_file}");
20
26
sleep 1;
43
49
  $spamd_pid = 0;
44
50
 
45
51
  dbgprint "starting new spamd, loop try $retry...\n";
 
52
  my $startat = time;
46
53
  start_spamd("-D -L --round-robin -r ${pid_file}");
47
54
 
48
55
  dbgprint "Waiting for spamd at pid $pid1 to restart...\n";
49
 
  wait_for_file_to_appear ($pid_file, 20);
50
 
  ok (-e $pid_file) or warn "$pid_file does not exist post restart";
 
56
  wait_for_file_to_appear ($pid_file, 40);
 
57
  ok (-e $pid_file) or warn "$pid_file does not exist post restart; started at $startat, gave up at ".time;
 
58
 
51
59
  ok (!-z $pid_file) or warn "$pid_file is empty post restart";
52
60
  ok ($pid2 = read_from_pidfile($pid_file));
53
61