Mercurial > hg > nginx-tests
comparison http_resolver_aaaa.t @ 1237:e4974af3fb12
Tests: adjusted udp ports to match allocated ports range.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Wed, 13 Sep 2017 19:04:25 +0300 |
parents | fcd65708672d |
children |
comparison
equal
deleted
inserted
replaced
1236:93f749c1d5c5 | 1237:e4974af3fb12 |
---|---|
40 listen 127.0.0.1:8080; | 40 listen 127.0.0.1:8080; |
41 listen [::1]:%%PORT_8080%%; | 41 listen [::1]:%%PORT_8080%%; |
42 server_name localhost; | 42 server_name localhost; |
43 | 43 |
44 location / { | 44 location / { |
45 resolver 127.0.0.1:%%PORT_8081_UDP%%; | 45 resolver 127.0.0.1:%%PORT_8981_UDP%%; |
46 proxy_pass http://$host:%%PORT_8080%%/backend; | 46 proxy_pass http://$host:%%PORT_8080%%/backend; |
47 | 47 |
48 proxy_next_upstream http_504 timeout error; | 48 proxy_next_upstream http_504 timeout error; |
49 proxy_intercept_errors on; | 49 proxy_intercept_errors on; |
50 proxy_connect_timeout 50ms; | 50 proxy_connect_timeout 50ms; |
51 error_page 504 502 /50x; | 51 error_page 504 502 /50x; |
52 add_header X-Host $upstream_addr; | 52 add_header X-Host $upstream_addr; |
53 } | 53 } |
54 location /two { | 54 location /two { |
55 resolver 127.0.0.1:%%PORT_8081_UDP%% 127.0.0.1:%%PORT_8082_UDP%%; | 55 resolver 127.0.0.1:%%PORT_8981_UDP%% 127.0.0.1:%%PORT_8982_UDP%%; |
56 proxy_pass http://$host:%%PORT_8080%%/backend; | 56 proxy_pass http://$host:%%PORT_8080%%/backend; |
57 } | 57 } |
58 | 58 |
59 location /backend { | 59 location /backend { |
60 return 200; | 60 return 200; |
67 | 67 |
68 EOF | 68 EOF |
69 | 69 |
70 $t->try_run('no inet6 support')->plan(72); | 70 $t->try_run('no inet6 support')->plan(72); |
71 | 71 |
72 $t->run_daemon(\&dns_daemon, port(8081), $t); | 72 $t->run_daemon(\&dns_daemon, port(8981), $t); |
73 $t->run_daemon(\&dns_daemon, port(8082), $t); | 73 $t->run_daemon(\&dns_daemon, port(8982), $t); |
74 | 74 |
75 $t->waitforfile($t->testdir . '/' . port(8081)); | 75 $t->waitforfile($t->testdir . '/' . port(8981)); |
76 $t->waitforfile($t->testdir . '/' . port(8082)); | 76 $t->waitforfile($t->testdir . '/' . port(8982)); |
77 | 77 |
78 ############################################################################### | 78 ############################################################################### |
79 | 79 |
80 my (@n, $response); | 80 my (@n, $response); |
81 | 81 |
330 push @rdata, pack('n3N nn8', 0xc031, AAAA, IN, $ttl, | 330 push @rdata, pack('n3N nn8', 0xc031, AAAA, IN, $ttl, |
331 16, expand_ip6("::1")); | 331 16, expand_ip6("::1")); |
332 } | 332 } |
333 | 333 |
334 } elsif ($name eq '2.example.net') { | 334 } elsif ($name eq '2.example.net') { |
335 if ($port == port(8081)) { | 335 if ($port == port(8981)) { |
336 $state->{twocnt}++; | 336 $state->{twocnt}++; |
337 } | 337 } |
338 if ($state->{twocnt} & 1) { | 338 if ($state->{twocnt} & 1) { |
339 $rcode = SERVFAIL; | 339 $rcode = SERVFAIL; |
340 } | 340 } |