comparison proxy_variables.t @ 1410:a1a3164faec8

Tests: harden proxy_variables.t, avoid uninitialized warnings.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 04 Dec 2018 17:07:18 +0300
parents 3783b937a1dc
children 16a8962ff246
comparison
equal deleted inserted replaced
1409:0bc5bd58d9de 1410:a1a3164faec8
20 ############################################################################### 20 ###############################################################################
21 21
22 select STDERR; $| = 1; 22 select STDERR; $| = 1;
23 select STDOUT; $| = 1; 23 select STDOUT; $| = 1;
24 24
25 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(22) 25 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(24)
26 ->write_file_expand('nginx.conf', <<'EOF'); 26 ->write_file_expand('nginx.conf', <<'EOF');
27 27
28 %%TEST_GLOBALS%% 28 %%TEST_GLOBALS%%
29 29
30 daemon off; 30 daemon off;
136 cmp_ok($ct2, '<', 1, 'connect time log - slow response body'); 136 cmp_ok($ct2, '<', 1, 'connect time log - slow response body');
137 137
138 TODO: { 138 TODO: {
139 local $TODO = 'not yet' unless $t->has_version('1.15.7'); 139 local $TODO = 'not yet' unless $t->has_version('1.15.7');
140 140
141 isnt($ct3, '-', 'connect time log - client close set');
142
143 }
144
145 $ct3 = 0 if $ct3 eq '-';
141 cmp_ok($ct3, '<', 1, 'connect time log - client close'); 146 cmp_ok($ct3, '<', 1, 'connect time log - client close');
142
143 }
144 147
145 cmp_ok($ht, '>=', 1, 'header time log - slow response header'); 148 cmp_ok($ht, '>=', 1, 'header time log - slow response header');
146 cmp_ok($ht2, '<', 1, 'header time log - slow response body'); 149 cmp_ok($ht2, '<', 1, 'header time log - slow response body');
147 is($ht3, '-', 'header time log - client close'); 150 is($ht3, '-', 'header time log - client close');
148 151
150 cmp_ok($rt2, '>=', 1, 'response time log - slow response body'); 153 cmp_ok($rt2, '>=', 1, 'response time log - slow response body');
151 154
152 TODO: { 155 TODO: {
153 local $TODO = 'not yet' unless $t->has_version('1.15.7'); 156 local $TODO = 'not yet' unless $t->has_version('1.15.7');
154 157
158 isnt($rt3, '-', 'response time log - client close set');
159 $rt3 = 0 if $rt3 eq '-';
155 cmp_ok($rt3, '>', $ct3, 'response time log - client close'); 160 cmp_ok($rt3, '>', $ct3, 'response time log - client close');
156 161
157 } 162 }
158 163
159 ############################################################################### 164 ###############################################################################