Mercurial > hg > nginx-tests
comparison stream_variables.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 | fcd65708672d |
children | e4974af3fb12 |
comparison
equal
deleted
inserted
replaced
1234:0defcc1c87ab | 1235:3fc6817cd84a |
---|---|
79 $t->try_run('no stream return or inet6 support')->plan(8); | 79 $t->try_run('no stream return or inet6 support')->plan(8); |
80 | 80 |
81 ############################################################################### | 81 ############################################################################### |
82 | 82 |
83 chomp(my $hostname = lc `hostname`); | 83 chomp(my $hostname = lc `hostname`); |
84 like(stream()->read(), qr/^\d+:[\d.]+:$hostname:\d+:0$/, 'vars'); | 84 like(stream('127.0.0.1:' . port(8080))->read(), |
85 qr/^\d+:[\d.]+:$hostname:\d+:0$/, 'vars'); | |
85 | 86 |
86 my $dport = port(8081); | 87 my $dport = port(8081); |
87 my $s = stream("127.0.0.1:$dport"); | 88 my $s = stream("127.0.0.1:$dport"); |
88 my $lport = $s->sockport(); | 89 my $lport = $s->sockport(); |
89 is($s->read(), "127.0.0.1:$lport:127.0.0.1:$dport", 'addr'); | 90 is($s->read(), "127.0.0.1:$lport:127.0.0.1:$dport", 'addr'); |