Mercurial > hg > nginx-tests
comparison stream_udp_limit_conn.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 | 99a83f7e7755 |
comparison
equal
deleted
inserted
replaced
1333:746d9ffdbd26 | 1334:c4f58dfe8207 |
---|---|
85 | 85 |
86 my $s = dgram('127.0.0.1:' . port(8981)); | 86 my $s = dgram('127.0.0.1:' . port(8981)); |
87 | 87 |
88 is($s->io('1'), '1', 'passed'); | 88 is($s->io('1'), '1', 'passed'); |
89 | 89 |
90 # if not all responses were sent to client, then new request | 90 # regardless of incomplete responses, new requests in the same |
91 # in same socket will be treated as new connection | 91 # socket will be treated as requests in existing session |
92 | 92 |
93 is($s->io('1', read_timeout => 0.1), '', 'rejected new connection'); | 93 TODO: { |
94 local $TODO = 'not yet' unless $t->has_version('1.15.0'); | |
95 | |
96 is($s->io('1', read_timeout => 0.1), '1', 'passed new request'); | |
97 | |
98 } | |
99 | |
94 is(dgram('127.0.0.1:' . port(8981))->io('1', read_timeout => 0.1), '', | 100 is(dgram('127.0.0.1:' . port(8981))->io('1', read_timeout => 0.1), '', |
95 'rejected same zone'); | 101 'rejected new session'); |
96 is(dgram('127.0.0.1:' . port(8982))->io('1'), '1', 'passed different zone'); | 102 is(dgram('127.0.0.1:' . port(8982))->io('1'), '1', 'passed different zone'); |
97 is(dgram('127.0.0.1:' . port(8983))->io('1'), '1', 'passed same zone unlimited'); | 103 is(dgram('127.0.0.1:' . port(8983))->io('1'), '1', 'passed same zone unlimited'); |
98 | 104 |
99 sleep 1; # waiting for proxy_timeout to expire | 105 sleep 1; # waiting for proxy_timeout to expire |
100 | 106 |
101 is($s->io('2', read => 2), '12', 'new connection after proxy_timeout'); | 107 is($s->io('2', read => 2), '12', 'new session after proxy_timeout'); |
102 | 108 |
103 is(dgram('127.0.0.1:' . port(8981))->io('2', read => 2), '12', 'passed 2'); | 109 is(dgram('127.0.0.1:' . port(8981))->io('2', read => 2), '12', 'passed 2'); |
104 | 110 |
105 # zones proxy chain | 111 # zones proxy chain |
106 | 112 |