Mercurial > hg > nginx-tests
comparison stream_proxy_protocol.t @ 618:2d9f5f439598
Tests: added stream proxy protocol availability check.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Mon, 29 Jun 2015 18:37:02 +0300 |
parents | bae9850e566c |
children | cf89559cd558 |
comparison
equal
deleted
inserted
replaced
617:35832048546e | 618:2d9f5f439598 |
---|---|
23 ############################################################################### | 23 ############################################################################### |
24 | 24 |
25 select STDERR; $| = 1; | 25 select STDERR; $| = 1; |
26 select STDOUT; $| = 1; | 26 select STDOUT; $| = 1; |
27 | 27 |
28 my $t = Test::Nginx->new()->has(qw/stream/)->plan(2) | 28 my $t = Test::Nginx->new()->has(qw/stream/) |
29 ->write_file_expand('nginx.conf', <<'EOF'); | 29 ->write_file_expand('nginx.conf', <<'EOF'); |
30 | 30 |
31 %%TEST_GLOBALS%% | 31 %%TEST_GLOBALS%% |
32 | 32 |
33 daemon off; | 33 daemon off; |
51 } | 51 } |
52 | 52 |
53 EOF | 53 EOF |
54 | 54 |
55 $t->run_daemon(\&stream_daemon); | 55 $t->run_daemon(\&stream_daemon); |
56 $t->run()->waitforsocket('127.0.0.1:8081'); | 56 $t->try_run('no stream proxy_protocol')->plan(2); |
57 $t->waitforsocket('127.0.0.1:8081'); | |
57 | 58 |
58 ############################################################################### | 59 ############################################################################### |
59 | 60 |
60 my %r = stream_get('close'); | 61 my %r = stream_get('close'); |
61 is($r{'data'}, "PROXY TCP4 127.0.0.1 127.0.0.1 $r{'sp'} 8080" . CRLF . "close", | 62 is($r{'data'}, "PROXY TCP4 127.0.0.1 127.0.0.1 $r{'sp'} 8080" . CRLF . "close", |