Mercurial > hg > nginx-tests
annotate mail_error_log.t @ 572:ca54b445d982
Tests: masked nginx bug in proxy next upstream.
When iterating through several next upstreams per a worker cycle,
a previously reported event about upstream connection error may
be improperly applied to the next upstream, thus leading to the
invalid connection error. E.g., in kqueue, where the problem is
visible, this is caused by "ev->instance" that does not tolerate
more than one next upstream at once, and kevents placed on the
kqueue separately for read and write events.
The change is to limit test case to the only one next upstream.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 14 May 2015 11:54:24 +0300 |
parents | f7bc1f74970a |
children | e9064d691790 |
rev | line source |
---|---|
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Sergey Kandaurov |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 # Tests for nginx mail imap module, error_log directive. |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 ############################################################################### |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 use warnings; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use strict; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use Test::More; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
15 use IO::Select; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
16 |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 BEGIN { use FindBin; chdir($FindBin::Bin); } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 use lib 'lib'; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 use Test::Nginx; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 use Test::Nginx::IMAP; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 ############################################################################### |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 select STDERR; $| = 1; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 select STDOUT; $| = 1; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 plan(skip_all => 'win32') if $^O eq 'MSWin32'; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 my $t = Test::Nginx->new()->has(qw/mail imap http rewrite/) |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 plan(skip_all => 'no error_log') unless $t->has_version('1.9.0'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
35 $t->plan(30)->write_file_expand('nginx.conf', <<'EOF'); |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 %%TEST_GLOBALS%% |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
38 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 error_log %%TESTDIR%%/e_glob.log info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 error_log %%TESTDIR%%/e_glob2.log info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 error_log syslog:server=127.0.0.1:8081 info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
42 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 daemon off; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 events { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
47 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 mail { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 auth_http http://127.0.0.1:8080/mail/auth; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 server { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 listen 127.0.0.1:8143; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 protocol imap; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
55 error_log %%TESTDIR%%/e_debug.log debug; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
56 error_log %%TESTDIR%%/e_info.log info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 error_log syslog:server=127.0.0.1:8082 info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 error_log stderr info; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 } |
570
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
60 |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
61 server { |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
62 listen 127.0.0.1:8145; |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
63 protocol imap; |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
64 |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
65 error_log syslog:server=127.0.0.1:8080 info; |
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
66 } |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
67 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
69 http { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 %%TEST_GLOBALS_HTTP%% |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
71 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
72 server { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
73 listen 127.0.0.1:8080; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
74 server_name localhost; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
75 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
76 location = /mail/auth { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
77 add_header Auth-Status OK; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
78 add_header Auth-Server 127.0.0.1; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
79 add_header Auth-Port 8144; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 add_header Auth-Wait 1; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
81 return 204; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
82 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
83 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
84 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
85 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 EOF |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
87 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
88 open OLDERR, ">&", \*STDERR; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 open STDERR, '>', $t->testdir() . '/stderr' or die "Can't reopen STDERR: $!"; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 open my $stderr, '<', $t->testdir() . '/stderr' |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
91 or die "Can't open stderr file: $!"; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
93 $t->run_daemon(\&syslog_daemon, 8081, $t, 's_glob.log'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
94 $t->run_daemon(\&syslog_daemon, 8082, $t, 's_info.log'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
96 $t->waitforfile($t->testdir . '/s_glob.log'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
97 $t->waitforfile($t->testdir . '/s_info.log'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 $t->run(); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 open STDERR, ">&", \*OLDERR; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 ############################################################################### |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
104 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
105 my $s = Test::Nginx::IMAP->new(); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
106 $s->ok('greeting'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
107 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
108 # error_log levels |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
109 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
110 SKIP: { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
111 skip "no --with-debug", 1 unless $t->has_module('--with-debug'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
112 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
113 isnt(lines($t, 'e_debug.log', '[debug]'), 0, 'file debug in debug'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
114 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
116 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 isnt(lines($t, 'e_info.log', '[info]'), 0, 'file info in info'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
118 is(lines($t, 'e_info.log', '[debug]'), 0, 'file debug in info'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
119 isnt(lines($t, 'stderr', '[info]'), 0, 'stderr info in info'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
120 is(lines($t, 'stderr', '[debug]'), 0, 'stderr debug in info'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
121 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
122 # multiple error_log |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
123 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
124 like($t->read_file('e_glob.log'), qr!nginx/[.0-9]+!, 'error global'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
125 like($t->read_file('e_glob2.log'), qr!nginx/[.0-9]+!, 'error global 2'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
126 is_deeply(levels($t, 'e_glob.log'), levels($t, 'e_glob2.log'), |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
127 'multiple error global'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
128 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 # syslog |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
130 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
131 parse_syslog_message('syslog', get_syslog()); |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
132 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
133 is_deeply(levels($t, 's_glob.log'), levels($t, 'e_glob.log'), |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
134 'global syslog messages'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
135 is_deeply(levels($t, 's_info.log'), levels($t, 'e_info.log'), |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
136 'mail syslog messages'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
137 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
138 ############################################################################### |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
139 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
140 sub lines { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
141 my ($t, $file, $pattern) = @_; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
142 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
143 if ($file eq 'stderr') { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
144 return map { $_ =~ /\Q$pattern\E/ } (<$stderr>); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
145 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
146 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
147 my $path = $t->testdir() . '/' . $file; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
148 open my $fh, '<', $path or return "$!"; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
149 my $value = map { $_ =~ /\Q$pattern\E/ } (<$fh>); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
150 close $fh; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
151 return $value; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
152 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
153 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
154 sub levels { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
155 my ($t, $file) = @_; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
156 my %levels_hash; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
157 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
158 map { $levels_hash{$_}++; } ($t->read_file($file) =~ /(\[\w+\])/g); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
159 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
160 return \%levels_hash; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
161 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
162 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
163 sub get_syslog { |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
164 my ($port) = @_; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
165 my $data = ''; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
166 my ($s); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
167 |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
168 $port = 8080 unless defined $port; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
169 |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
170 eval { |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
171 local $SIG{ALRM} = sub { die "timeout\n" }; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
172 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
173 alarm(1); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
174 $s = IO::Socket::INET->new( |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
175 Proto => 'udp', |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
176 LocalAddr => "127.0.0.1:$port" |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
177 ); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
178 alarm(0); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
179 }; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
180 alarm(0); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
181 if ($@) { |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
182 log_in("died: $@"); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
183 return undef; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
184 } |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
185 |
570
f7bc1f74970a
Tests: avoid send errors in syslog tests with mail error_log.
Sergey Kandaurov <pluknet@nginx.com>
parents:
569
diff
changeset
|
186 Test::Nginx::IMAP->new(PeerAddr => "127.0.0.1:8145")->read(); |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
187 |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
188 IO::Select->new($s)->can_read(1.5); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
189 while (IO::Select->new($s)->can_read(0.1)) { |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
190 my $buffer; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
191 sysread($s, $buffer, 4096); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
192 $data .= $buffer; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
193 } |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
194 $s->close(); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
195 return $data; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
196 } |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
197 |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
198 sub parse_syslog_message { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
199 my ($desc, $line) = @_; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
200 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
201 ok($line, $desc); |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
202 |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
203 SKIP: { |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
204 skip "$desc timeout", 18 unless $line; |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
205 |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
206 my @months = ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
207 'Sep', 'Oct', 'Nov', 'Dec'); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
208 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
209 my ($pri, $mon, $mday, $hour, $minute, $sec, $host, $tag, $msg) = |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
210 $line =~ /^<(\d{1,3})> # PRI |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
211 ([A-Z][a-z]{2})\s # mon |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
212 ([ \d]\d)\s(\d{2}):(\d{2}):(\d{2})\s # date |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
213 ([\S]*)\s # host |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
214 (\w{1,32}):\s # tag |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
215 (.*)/x; # MSG |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
216 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
217 my $sev = $pri & 0x07; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
218 my $fac = ($pri & 0x03f8) >> 3; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
219 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
220 ok(defined($pri), "$desc has PRI"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
221 ok($sev >= 0 && $sev <= 7, "$desc valid severity"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
222 ok($fac >= 0 && $fac < 24, "$desc valid facility"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
223 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
224 ok(defined($mon), "$desc has month"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
225 ok((grep $mon, @months), "$desc valid month"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
226 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
227 ok(defined($mday), "$desc has day"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
228 ok($mday <= 31, "$desc valid day"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
229 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
230 ok(defined($hour), "$desc has hour"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
231 ok($hour < 24, "$desc valid hour"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
232 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
233 ok(defined($minute), "$desc has minutes"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
234 ok($minute < 60, "$desc valid minutes"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
235 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
236 ok(defined($sec), "$desc has seconds"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
237 ok($sec < 60, "$desc valid seconds"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
238 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
239 ok(defined($host), "$desc has host"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
240 chomp(my $hostname = lc `hostname`); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
241 is($host , $hostname, "$desc valid host"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
242 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
243 ok(defined($tag), "$desc has tag"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
244 like($tag, qr'\w+', "$desc valid tag"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
245 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
246 ok(length($msg) > 0, "$desc valid CONTENT"); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
247 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
248 |
569
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
249 } |
adbb9b5108aa
Tests: fixed mail error_log test timeouts similar to 22bade4c7e12.
Sergey Kandaurov <pluknet@nginx.com>
parents:
564
diff
changeset
|
250 |
564
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
251 ############################################################################### |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
252 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
253 sub syslog_daemon { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
254 my ($port, $t, $file) = @_; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
255 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
256 my $s = IO::Socket::INET->new( |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
257 Proto => 'udp', |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
258 LocalAddr => "127.0.0.1:$port" |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
259 ); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
260 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
261 open my $fh, '>', $t->testdir() . '/' . $file; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
262 select $fh; $| = 1; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
263 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
264 while (1) { |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
265 my $buffer; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
266 $s->recv($buffer, 4096); |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
267 print $fh $buffer . "\n"; |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
268 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
269 } |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
270 |
a1c93746570d
Tests: mail error_log tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
271 ############################################################################### |