comparison stream_proxy.t @ 1235:3fc6817cd84a

Tests: explicit peer port in stream tests now required. Notably, this eliminates extra port acquire for the default port number in cases when it was not actually used.
author Andrey Zelenkov <zelenkov@nginx.com>
date Thu, 26 Oct 2017 16:36:13 +0300
parents 882267679006
children f3ba4c74de31
comparison
equal deleted inserted replaced
1234:0defcc1c87ab 1235:3fc6817cd84a
48 $t->run_daemon(\&stream_daemon); 48 $t->run_daemon(\&stream_daemon);
49 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); 49 $t->run()->waitforsocket('127.0.0.1:' . port(8081));
50 50
51 ############################################################################### 51 ###############################################################################
52 52
53 my $s = stream(); 53 my $s = stream('127.0.0.1:' . port(8080));
54 54
55 is($s->io('foo1', length => 4), 'bar1', 'proxy connection'); 55 is($s->io('foo1', length => 4), 'bar1', 'proxy connection');
56 is($s->io('foo3', length => 4), 'bar3', 'proxy connection again'); 56 is($s->io('foo3', length => 4), 'bar3', 'proxy connection again');
57 is($s->io('close'), 'close', 'proxy connection close'); 57 is($s->io('close'), 'close', 'proxy connection close');
58 is($s->io('test'), '', 'proxy connection closed'); 58 is($s->io('test'), '', 'proxy connection closed');
59 59
60 $s = stream(); 60 $s = stream('127.0.0.1:' . port(8080));
61 61
62 sleep 3; 62 sleep 3;
63 63
64 is($s->io('foo', length => 3), 'bar', 'proxy connect timeout'); 64 is($s->io('foo', length => 3), 'bar', 'proxy connect timeout');
65 65