Mercurial > hg > nginx-tests
comparison proxy.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 | 7959e58429d0 |
children |
comparison
equal
deleted
inserted
replaced
1534:96fb3513345b | 1535:144c6ce732e4 |
---|---|
19 ############################################################################### | 19 ############################################################################### |
20 | 20 |
21 select STDERR; $| = 1; | 21 select STDERR; $| = 1; |
22 select STDOUT; $| = 1; | 22 select STDOUT; $| = 1; |
23 | 23 |
24 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(30); | 24 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(28); |
25 | 25 |
26 $t->write_file_expand('nginx.conf', <<'EOF'); | 26 $t->write_file_expand('nginx.conf', <<'EOF'); |
27 | 27 |
28 %%TEST_GLOBALS%% | 28 %%TEST_GLOBALS%% |
29 | 29 |
135 | 135 |
136 # expect no header time in 1st (bad) upstream, no (yet) response time in 2nd | 136 # expect no header time in 1st (bad) upstream, no (yet) response time in 2nd |
137 | 137 |
138 $re = qr/(\d\.\d{3}|-)/; | 138 $re = qr/(\d\.\d{3}|-)/; |
139 ($ct, $ct2, $ht, $ht2, $rt, $rt2) = get('/pnu', many => 1); | 139 ($ct, $ct2, $ht, $ht2, $rt, $rt2) = get('/pnu', many => 1); |
140 | |
140 cmp_ok($ct, '<', 1, 'connect time - next'); | 141 cmp_ok($ct, '<', 1, 'connect time - next'); |
141 cmp_ok($ct2, '<', 1, 'connect time - next 2'); | 142 cmp_ok($ct2, '<', 1, 'connect time - next 2'); |
142 | 143 |
143 TODO: { | |
144 local $TODO = 'not yet' unless $t->has_version('1.15.7'); | |
145 | |
146 is($ht, '-', 'header time - next'); | 144 is($ht, '-', 'header time - next'); |
147 | |
148 } | |
149 | |
150 cmp_ok($ht2, '<', 1, 'header time - next 2'); | 145 cmp_ok($ht2, '<', 1, 'header time - next 2'); |
146 | |
151 cmp_ok($rt, '>=', 1, 'response time - next'); | 147 cmp_ok($rt, '>=', 1, 'response time - next'); |
152 | |
153 TODO: { | |
154 local $TODO = 'not yet' unless $t->has_version('1.15.7'); | |
155 | |
156 is($rt2, '-', 'response time - next 2'); | 148 is($rt2, '-', 'response time - next 2'); |
157 | |
158 } | |
159 | 149 |
160 $t->stop(); | 150 $t->stop(); |
161 | 151 |
162 ($ct, $ht, $rt, $ct2, $ht2, $rt2, $ct3, $ht3, $rt3) | 152 ($ct, $ht, $rt, $ct2, $ht2, $rt2, $ct3, $ht3, $rt3) |
163 = $t->read_file('time.log') =~ /^$re:$re:$re\n$re:$re:$re\n$re:$re:$re$/; | 153 = $t->read_file('time.log') =~ /^$re:$re:$re\n$re:$re:$re\n$re:$re:$re$/; |
164 | 154 |
165 cmp_ok($ct, '<', 1, 'connect time log - slow response header'); | 155 cmp_ok($ct, '<', 1, 'connect time log - slow response header'); |
166 cmp_ok($ct2, '<', 1, 'connect time log - slow response body'); | 156 cmp_ok($ct2, '<', 1, 'connect time log - slow response body'); |
167 | |
168 TODO: { | |
169 local $TODO = 'not yet' unless $t->has_version('1.15.7'); | |
170 | |
171 isnt($ct3, '-', 'connect time log - client close set'); | |
172 | |
173 } | |
174 | |
175 $ct3 = 0 if $ct3 eq '-'; | |
176 cmp_ok($ct3, '<', 1, 'connect time log - client close'); | 157 cmp_ok($ct3, '<', 1, 'connect time log - client close'); |
177 | 158 |
178 cmp_ok($ht, '>=', 1, 'header time log - slow response header'); | 159 cmp_ok($ht, '>=', 1, 'header time log - slow response header'); |
179 cmp_ok($ht2, '<', 1, 'header time log - slow response body'); | 160 cmp_ok($ht2, '<', 1, 'header time log - slow response body'); |
180 is($ht3, '-', 'header time log - client close'); | 161 is($ht3, '-', 'header time log - client close'); |
181 | 162 |
182 cmp_ok($rt, '>=', 1, 'response time log - slow response header'); | 163 cmp_ok($rt, '>=', 1, 'response time log - slow response header'); |
183 cmp_ok($rt2, '>=', 1, 'response time log - slow response body'); | 164 cmp_ok($rt2, '>=', 1, 'response time log - slow response body'); |
184 | |
185 TODO: { | |
186 local $TODO = 'not yet' unless $t->has_version('1.15.7'); | |
187 | |
188 isnt($rt3, '-', 'response time log - client close set'); | |
189 $rt3 = 0 if $rt3 eq '-'; | |
190 cmp_ok($rt3, '>', $ct3, 'response time log - client close'); | 165 cmp_ok($rt3, '>', $ct3, 'response time log - client close'); |
191 | |
192 } | |
193 | 166 |
194 ############################################################################### | 167 ############################################################################### |
195 | 168 |
196 sub get { | 169 sub get { |
197 my ($uri, %extra) = @_; | 170 my ($uri, %extra) = @_; |