Mercurial > hg > nginx-tests
comparison mail_smtp_xclient.t @ 976:a8b8dd6e8ae1
Tests: changed startup order in mail tests for consistency.
Notably, run_daemon() is postponed until after write_file_expand().
Also added waitforsocket() to avoid startup race.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 12 Jul 2016 20:51:06 +0300 |
parents | c227348453db |
children | 74986ebee2fd |
comparison
equal
deleted
inserted
replaced
975:e17ffab3febc | 976:a8b8dd6e8ae1 |
---|---|
23 select STDOUT; $| = 1; | 23 select STDOUT; $| = 1; |
24 | 24 |
25 local $SIG{PIPE} = 'IGNORE'; | 25 local $SIG{PIPE} = 'IGNORE'; |
26 | 26 |
27 my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)->plan(6) | 27 my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)->plan(6) |
28 ->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon, port(8026)) | 28 ->write_file_expand('nginx.conf', <<'EOF'); |
29 ->write_file_expand('nginx.conf', <<'EOF')->run(); | |
30 | 29 |
31 %%TEST_GLOBALS%% | 30 %%TEST_GLOBALS%% |
32 | 31 |
33 daemon off; | 32 daemon off; |
34 | 33 |
63 } | 62 } |
64 } | 63 } |
65 } | 64 } |
66 | 65 |
67 EOF | 66 EOF |
67 | |
68 $t->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon); | |
69 $t->run()->waitforsocket('127.0.0.1:' . port(8026)); | |
68 | 70 |
69 ############################################################################### | 71 ############################################################################### |
70 | 72 |
71 # When XCLIENT's HELO= argument isn't used, the following combinations may be | 73 # When XCLIENT's HELO= argument isn't used, the following combinations may be |
72 # send to backend with xclient on: | 74 # send to backend with xclient on: |