Mercurial > hg > nginx-tests
comparison mail_error_log.t @ 570:f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Use a separate mail server block for syslog parsing tests to make sure
that syslog messages are always read by the receiver on the remote side.
Otherwise, syslog message might not be sent due to a pending socket error.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 07 May 2015 14:28:44 +0300 |
parents | adbb9b5108aa |
children | e9064d691790 |
comparison
equal
deleted
inserted
replaced
569:adbb9b5108aa | 570:f7bc1f74970a |
---|---|
52 listen 127.0.0.1:8143; | 52 listen 127.0.0.1:8143; |
53 protocol imap; | 53 protocol imap; |
54 | 54 |
55 error_log %%TESTDIR%%/e_debug.log debug; | 55 error_log %%TESTDIR%%/e_debug.log debug; |
56 error_log %%TESTDIR%%/e_info.log info; | 56 error_log %%TESTDIR%%/e_info.log info; |
57 error_log syslog:server=127.0.0.1:8080 info; | |
58 error_log syslog:server=127.0.0.1:8082 info; | 57 error_log syslog:server=127.0.0.1:8082 info; |
59 error_log stderr info; | 58 error_log stderr info; |
59 } | |
60 | |
61 server { | |
62 listen 127.0.0.1:8145; | |
63 protocol imap; | |
64 | |
65 error_log syslog:server=127.0.0.1:8080 info; | |
60 } | 66 } |
61 } | 67 } |
62 | 68 |
63 http { | 69 http { |
64 %%TEST_GLOBALS_HTTP%% | 70 %%TEST_GLOBALS_HTTP%% |
175 if ($@) { | 181 if ($@) { |
176 log_in("died: $@"); | 182 log_in("died: $@"); |
177 return undef; | 183 return undef; |
178 } | 184 } |
179 | 185 |
180 Test::Nginx::IMAP->new(); | 186 Test::Nginx::IMAP->new(PeerAddr => "127.0.0.1:8145")->read(); |
181 | 187 |
182 IO::Select->new($s)->can_read(1.5); | 188 IO::Select->new($s)->can_read(1.5); |
183 while (IO::Select->new($s)->can_read(0.1)) { | 189 while (IO::Select->new($s)->can_read(0.1)) { |
184 my $buffer; | 190 my $buffer; |
185 sysread($s, $buffer, 4096); | 191 sysread($s, $buffer, 4096); |