Mercurial > hg > nginx-tests
comparison debug_connection_syslog.t @ 952:e9064d691790
Tests: converted tests to run in parallel.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jun 2016 16:39:13 +0300 |
parents | 907e89fba9c3 |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
951:9361c7eddfc1 | 952:e9064d691790 |
---|---|
34 } | 34 } |
35 | 35 |
36 http { | 36 http { |
37 %%TEST_GLOBALS_HTTP%% | 37 %%TEST_GLOBALS_HTTP%% |
38 | 38 |
39 error_log syslog:server=127.0.0.1:8080 alert; | 39 error_log syslog:server=127.0.0.1:%%PORT_1_UDP%% alert; |
40 error_log syslog:server=127.0.0.1:8081 alert; | 40 error_log syslog:server=127.0.0.1:%%PORT_2_UDP%% alert; |
41 | 41 |
42 server { | 42 server { |
43 listen 127.0.0.1:8080; | 43 listen 127.0.0.1:%%PORT_0%%; |
44 listen [::1]:8080; | 44 listen [::1]:%%PORT_0%%; |
45 server_name localhost; | 45 server_name localhost; |
46 | 46 |
47 location /debug { | 47 location /debug { |
48 proxy_pass http://[::1]:8080/; | 48 proxy_pass http://[::1]:%%PORT_0%%/; |
49 } | 49 } |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
53 EOF | 53 EOF |
61 | 61 |
62 $t->plan(5); | 62 $t->plan(5); |
63 | 63 |
64 ############################################################################### | 64 ############################################################################### |
65 | 65 |
66 is(get_syslog('/', 8080), '', 'no debug_connection syslog 1'); | 66 is(get_syslog('/', port(1)), '', 'no debug_connection syslog 1'); |
67 is(get_syslog('/', 8081), '', 'no debug_connection syslog 2'); | 67 is(get_syslog('/', port(2)), '', 'no debug_connection syslog 2'); |
68 | 68 |
69 my @msgs = get_syslog('/debug', 8080, 8081); | 69 my @msgs = get_syslog('/debug', port(1), port(2)); |
70 like($msgs[0], qr/\[debug\]/, 'debug_connection syslog 1'); | 70 like($msgs[0], qr/\[debug\]/, 'debug_connection syslog 1'); |
71 like($msgs[1], qr/\[debug\]/, 'debug_connection syslog 2'); | 71 like($msgs[1], qr/\[debug\]/, 'debug_connection syslog 2'); |
72 is($msgs[0], $msgs[1], 'debug_connection syslog1 syslog2 match'); | 72 is($msgs[0], $msgs[1], 'debug_connection syslog1 syslog2 match'); |
73 | 73 |
74 ############################################################################### | 74 ############################################################################### |