Mercurial > hg > nginx-tests
comparison stream_udp_proxy.t @ 1334:c4f58dfe8207
Tests: stream udp tests adjusted for upcoming udp streams.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 24 May 2018 20:52:00 +0300 |
parents | e4974af3fb12 |
children | 42e37e0434d5 |
comparison
equal
deleted
inserted
replaced
1333:746d9ffdbd26 | 1334:c4f58dfe8207 |
---|---|
20 ############################################################################### | 20 ############################################################################### |
21 | 21 |
22 select STDERR; $| = 1; | 22 select STDERR; $| = 1; |
23 select STDOUT; $| = 1; | 23 select STDOUT; $| = 1; |
24 | 24 |
25 my $t = Test::Nginx->new()->has(qw/stream udp/)->plan(5) | 25 my $t = Test::Nginx->new()->has(qw/stream udp/)->plan(4) |
26 ->write_file_expand('nginx.conf', <<'EOF'); | 26 ->write_file_expand('nginx.conf', <<'EOF'); |
27 | 27 |
28 %%TEST_GLOBALS%% | 28 %%TEST_GLOBALS%% |
29 | 29 |
30 daemon off; | 30 daemon off; |
67 my $s = dgram('127.0.0.1:' . port(8980)); | 67 my $s = dgram('127.0.0.1:' . port(8980)); |
68 is($s->io('1', read => 1, read_timeout => 0.5), '', 'proxy responses 0'); | 68 is($s->io('1', read => 1, read_timeout => 0.5), '', 'proxy responses 0'); |
69 | 69 |
70 $s = dgram('127.0.0.1:' . port(8982)); | 70 $s = dgram('127.0.0.1:' . port(8982)); |
71 is($s->io('1'), '1', 'proxy responses 1'); | 71 is($s->io('1'), '1', 'proxy responses 1'); |
72 $s = dgram('127.0.0.1:' . port(8982)); | |
72 is($s->io('2', read => 2), '12', 'proxy responses 2'); | 73 is($s->io('2', read => 2), '12', 'proxy responses 2'); |
73 is($s->io('3', read => 3, read_timeout => 0.5), '12', 'proxy responses 3'); | |
74 | 74 |
75 $s = dgram('127.0.0.1:' . port(8983)); | 75 $s = dgram('127.0.0.1:' . port(8983)); |
76 is($s->io('3', read => 3), '123', 'proxy responses default'); | 76 is($s->io('3', read => 3), '123', 'proxy responses default'); |
77 | 77 |
78 ############################################################################### | 78 ############################################################################### |