Mercurial > hg > nginx-tests
comparison stream_udp_limit_rate.t @ 1535:144c6ce732e4
Tests: removed TODO and try_run() checks for legacy versions.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 02 Dec 2019 14:56:37 +0300 |
parents | 760fdf2865bb |
children | f3ba4c74de31 |
comparison
equal
deleted
inserted
replaced
1534:96fb3513345b | 1535:144c6ce732e4 |
---|---|
21 ############################################################################### | 21 ############################################################################### |
22 | 22 |
23 select STDERR; $| = 1; | 23 select STDERR; $| = 1; |
24 select STDOUT; $| = 1; | 24 select STDOUT; $| = 1; |
25 | 25 |
26 my $t = Test::Nginx->new()->has(qw/stream udp/) | 26 my $t = Test::Nginx->new()->has(qw/stream udp/)->plan(8) |
27 ->write_file_expand('nginx.conf', <<'EOF'); | 27 ->write_file_expand('nginx.conf', <<'EOF'); |
28 | 28 |
29 %%TEST_GLOBALS%% | 29 %%TEST_GLOBALS%% |
30 | 30 |
31 daemon off; | 31 daemon off; |
57 } | 57 } |
58 | 58 |
59 EOF | 59 EOF |
60 | 60 |
61 $t->run_daemon(\&udp_daemon, port(8980), $t); | 61 $t->run_daemon(\&udp_daemon, port(8980), $t); |
62 $t->try_run('no proxy_requests')->plan(8); | 62 $t->run(); |
63 | 63 |
64 $t->waitforfile($t->testdir . '/' . port(8980)); | 64 $t->waitforfile($t->testdir . '/' . port(8980)); |
65 | 65 |
66 ############################################################################### | 66 ############################################################################### |
67 | 67 |
73 is($s->io($str), $str, 'unlimited'); | 73 is($s->io($str), $str, 'unlimited'); |
74 is($s->io($str), $str, 'unlimited 2'); | 74 is($s->io($str), $str, 'unlimited 2'); |
75 | 75 |
76 # datagram doesn't get split | 76 # datagram doesn't get split |
77 | 77 |
78 my $t1; | |
79 | |
80 TODO: { | |
81 local $TODO = 'split datagram' unless $t->has_version('1.15.9'); | |
82 | |
83 $s = dgram('127.0.0.1:' . port(8983)); | 78 $s = dgram('127.0.0.1:' . port(8983)); |
84 is($s->io($str), $str, 'download'); | 79 is($s->io($str), $str, 'download'); |
85 $t1 = time(); | 80 my $t1 = time(); |
86 is($s->io($str), $str, 'download 2'); | 81 is($s->io($str), $str, 'download 2'); |
87 | |
88 } | |
89 | |
90 my $t2 = time(); | 82 my $t2 = time(); |
91 cmp_ok($t1, '<', $t2, 'download 2 delayed'); | 83 cmp_ok($t1, '<', $t2, 'download 2 delayed'); |
92 | 84 |
93 TODO: { | 85 # infinite event report before 1.15.9 |
94 todo_skip 'infinite event report', 3 unless $t->has_version('1.15.9'); | |
95 | 86 |
96 $s = dgram('127.0.0.1:' . port(8984)); | 87 $s = dgram('127.0.0.1:' . port(8984)); |
97 is($s->io($str), $str, 'upload'); | 88 is($s->io($str), $str, 'upload'); |
98 is($s->io($str, read_timeout => 0.5), '', 'upload limited'); | 89 is($s->io($str, read_timeout => 0.5), '', 'upload limited'); |
99 | 90 |
100 select undef, undef, undef, 1.6; | 91 select undef, undef, undef, 1.6; |
101 is($s->io($str), $str, 'upload passed'); | 92 is($s->io($str), $str, 'upload passed'); |
102 | |
103 } | |
104 | 93 |
105 ############################################################################### | 94 ############################################################################### |
106 | 95 |
107 sub udp_daemon { | 96 sub udp_daemon { |
108 my ($port, $t) = @_; | 97 my ($port, $t) = @_; |