comparison http_resolver.t @ 397:847ea345becb

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 05 May 2014 11:46:01 +0400
parents 81fed52bfca5
children 4984dac109db
comparison
equal deleted inserted replaced
396:5eb0df61f371 397:847ea345becb
90 like(http_host_header('a.example.net', '/'), qr/200 OK/, 'A'); 90 like(http_host_header('a.example.net', '/'), qr/200 OK/, 'A');
91 91
92 # ensure that resolver serves queries from cache in a case-insensitive manner 92 # ensure that resolver serves queries from cache in a case-insensitive manner
93 # we check this by marking 2nd and subsequent queries on backend with SERVFAIL 93 # we check this by marking 2nd and subsequent queries on backend with SERVFAIL
94 94
95 TODO: {
96 local $TODO = 'not yet' unless $t->has_version('1.5.8');
97
98 http_x_name_header('case.example.net', '/case'); 95 http_x_name_header('case.example.net', '/case');
99 like(http_x_name_header('CASE.example.net', '/case'), qr/200 OK/, 96 like(http_x_name_header('CASE.example.net', '/case'), qr/200 OK/,
100 'A case-insensitive'); 97 'A case-insensitive');
101
102 }
103 98
104 like(http_host_header('awide.example.net', '/'), qr/200 OK/, 'A uncompressed'); 99 like(http_host_header('awide.example.net', '/'), qr/200 OK/, 'A uncompressed');
105 like(http_host_header('short.example.net', '/'), qr/502 Bad/, 100 like(http_host_header('short.example.net', '/'), qr/502 Bad/,
106 'A short dns response'); 101 'A short dns response');
107 102
202 # expired "valid" value causes nginx to make actual query 197 # expired "valid" value causes nginx to make actual query
203 198
204 like(http_host_header('ttl.example.net', '/valid'), qr/502 Bad/, 199 like(http_host_header('ttl.example.net', '/valid'), qr/502 Bad/,
205 'valid expired'); 200 'valid expired');
206 201
207 TODO: {
208 local $TODO = 'not yet' unless $t->has_version('1.5.9');
209
210 # Ensure that resolver respects expired CNAME in CNAME + A combined response. 202 # Ensure that resolver respects expired CNAME in CNAME + A combined response.
211 # When ttl in CNAME is expired, the answer should not be served from cache. 203 # When ttl in CNAME is expired, the answer should not be served from cache.
212 # Catch this by returning SERVFAIL on the 2nd and subsequent queries. 204 # Catch this by returning SERVFAIL on the 2nd and subsequent queries.
213 205
214 http_host_header('cname_a_ttl2.example.net', '/'); 206 http_host_header('cname_a_ttl2.example.net', '/');
215 207
216 sleep 2; 208 sleep 2;
217 209
218 like(http_host_header('cname_a_ttl2.example.net', '/'), qr/502 Bad/, 210 like(http_host_header('cname_a_ttl2.example.net', '/'), qr/502 Bad/,
219 'CNAME + A with expired CNAME ttl'); 211 'CNAME + A with expired CNAME ttl');
220
221 }
222 212
223 like(http_host_header('example.net', '/invalid'), qr/502 Bad/, 'no resolver'); 213 like(http_host_header('example.net', '/invalid'), qr/502 Bad/, 'no resolver');
224 214
225 ############################################################################### 215 ###############################################################################
226 216