Mercurial > hg > nginx-tests
changeset 1010:4f739c15069e
Tests: stream $protocol tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 26 Aug 2016 16:28:22 +0300 |
parents | 9f576b8bb4c8 |
children | 9b87810c75ca |
files | stream_variables.t |
diffstat | 1 files changed, 11 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/stream_variables.t Tue Aug 23 14:04:56 2016 +0300 +++ b/stream_variables.t Fri Aug 26 16:28:22 2016 +0300 @@ -16,7 +16,7 @@ use lib 'lib'; use Test::Nginx; -use Test::Nginx::Stream qw/ stream /; +use Test::Nginx::Stream qw/ stream dgram /; ############################################################################### @@ -66,11 +66,17 @@ listen 127.0.0.1:8085; return $msec!$time_local!$time_iso8601; } + + server { + listen 127.0.0.1:8086; + listen 127.0.0.1:%%PORT_8087_UDP%% udp; + return $protocol; + } } EOF -$t->try_run('no stream return')->plan(6); +$t->try_run('no stream return')->plan(8); ############################################################################### @@ -94,4 +100,7 @@ $data = stream('127.0.0.1:' . port(8085))->read(); like($data, qr#^\d+.\d+![-+\w/: ]+![-+\dT:]+$#, 'time'); +is(stream('127.0.0.1:' . port(8086))->read(), 'TCP', 'protocol TCP'); +is(dgram('127.0.0.1:' . port(8087))->io('.'), 'UDP', 'protocol UDP'); + ###############################################################################