comparison mail_resolver.t @ 355:14eba1ad0880

Tests: reduce race in mail resolver test.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 21 Nov 2013 15:07:16 +0400
parents 145c37f27c5a
children e0c00e695cb5
comparison
equal deleted inserted replaced
354:fb366c51eac6 355:14eba1ad0880
1 #!/usr/bin/perl 1 #!/usr/bin/perl
2 2
3 # (C) Sergey Kandaurov 3 # (C) Sergey Kandaurov
4 # (C) Nginx, Inc. 4 # (C) Nginx, Inc.
5 5
6 # Tests for mail resolver 6 # Tests for mail resolver.
7 7
8 ############################################################################### 8 ###############################################################################
9 9
10 use warnings; 10 use warnings;
11 use strict; 11 use strict;
26 local $SIG{PIPE} = 'IGNORE'; 26 local $SIG{PIPE} = 'IGNORE';
27 27
28 eval { require Net::DNS::Nameserver; }; 28 eval { require Net::DNS::Nameserver; };
29 plan(skip_all => "Net::DNS::Nameserver not installed") if $@; 29 plan(skip_all => "Net::DNS::Nameserver not installed") if $@;
30 30
31 my $t = Test::Nginx->new()->has(qw/http mail smtp rewrite/); 31 my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)
32 ->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon);
32 33
33 $t->write_file_expand('nginx.conf', <<'EOF'); 34 $t->write_file_expand('nginx.conf', <<'EOF');
34 35
35 %%TEST_GLOBALS%% 36 %%TEST_GLOBALS%%
36 37
98 99
99 $t->run_daemon(\&dns_daemon, 8081); 100 $t->run_daemon(\&dns_daemon, 8081);
100 $t->run_daemon(\&dns_daemon, 8082); 101 $t->run_daemon(\&dns_daemon, 8082);
101 $t->run_daemon(\&dns_daemon, 8083); 102 $t->run_daemon(\&dns_daemon, 8083);
102 $t->run_daemon(\&dns_daemon, 8084); 103 $t->run_daemon(\&dns_daemon, 8084);
103 $t->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon);
104 $t->run(); 104 $t->run();
105 105
106 $t->waitforsocket('127.0.0.1:8081'); 106 $t->waitforsocket('127.0.0.1:8081');
107 $t->waitforsocket('127.0.0.1:8082'); 107 $t->waitforsocket('127.0.0.1:8082');
108 $t->waitforsocket('127.0.0.1:8083'); 108 $t->waitforsocket('127.0.0.1:8083');