comparison proxy_next_upstream_tries.t @ 952:e9064d691790

Tests: converted tests to run in parallel.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 21 Jun 2016 16:39:13 +0300
parents b1fa8e0cc27b
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
36 36
37 http { 37 http {
38 %%TEST_GLOBALS_HTTP%% 38 %%TEST_GLOBALS_HTTP%%
39 39
40 upstream u { 40 upstream u {
41 server 127.0.0.1:8081; 41 server 127.0.0.1:%%PORT_1%%;
42 server 127.0.0.1:8081; 42 server 127.0.0.1:%%PORT_1%%;
43 server 127.0.0.1:8081; 43 server 127.0.0.1:%%PORT_1%%;
44 } 44 }
45 45
46 upstream u2 { 46 upstream u2 {
47 server 127.0.0.1:8081; 47 server 127.0.0.1:%%PORT_1%%;
48 server 127.0.0.1:8081 backup; 48 server 127.0.0.1:%%PORT_1%% backup;
49 server 127.0.0.1:8081 backup; 49 server 127.0.0.1:%%PORT_1%% backup;
50 } 50 }
51 51
52 server { 52 server {
53 listen 127.0.0.1:8080; 53 listen 127.0.0.1:%%PORT_0%%;
54 server_name localhost; 54 server_name localhost;
55 55
56 proxy_next_upstream http_404; 56 proxy_next_upstream http_404;
57 proxy_intercept_errors on; 57 proxy_intercept_errors on;
58 error_page 404 /404; 58 error_page 404 /404;
66 proxy_pass http://u2; 66 proxy_pass http://u2;
67 proxy_next_upstream_tries 2; 67 proxy_next_upstream_tries 2;
68 } 68 }
69 69
70 location /tries/resolver { 70 location /tries/resolver {
71 resolver 127.0.0.1:8083; 71 resolver 127.0.0.1:%%PORT_2_UDP%%;
72 72
73 proxy_pass http://$host:8081; 73 proxy_pass http://$host:%%PORT_1%%;
74 proxy_next_upstream_tries 2; 74 proxy_next_upstream_tries 2;
75 } 75 }
76 76
77 location /tries/zero { 77 location /tries/zero {
78 proxy_pass http://u; 78 proxy_pass http://u;
88 proxy_pass http://u2/w2; 88 proxy_pass http://u2/w2;
89 proxy_next_upstream_timeout 3800ms; 89 proxy_next_upstream_timeout 3800ms;
90 } 90 }
91 91
92 location /timeout/resolver { 92 location /timeout/resolver {
93 resolver 127.0.0.1:8083; 93 resolver 127.0.0.1:%%PORT_2_UDP%%;
94 94
95 proxy_pass http://$host:8081/w2; 95 proxy_pass http://$host:%%PORT_1%%/w2;
96 proxy_next_upstream_timeout 3800ms; 96 proxy_next_upstream_timeout 3800ms;
97 } 97 }
98 98
99 location /timeout/zero { 99 location /timeout/zero {
100 proxy_pass http://u/w; 100 proxy_pass http://u/w;
107 } 107 }
108 } 108 }
109 109
110 EOF 110 EOF
111 111
112 $t->run_daemon(\&http_daemon, 8081); 112 $t->run_daemon(\&http_daemon, port(1));
113 $t->run_daemon(\&dns_daemon, 8083, $t); 113 $t->run_daemon(\&dns_daemon, port(2), $t);
114 $t->run(); 114 $t->run();
115 115
116 $t->waitforsocket('127.0.0.1:8081'); 116 $t->waitforsocket('127.0.0.1:' . port(1));
117 $t->waitforfile($t->testdir . '/8083'); 117 $t->waitforfile($t->testdir . '/' . port(2));
118 118
119 ############################################################################### 119 ###############################################################################
120 120
121 like(http_get('/tries'), qr/x404, 404x/, 'tries'); 121 like(http_get('/tries'), qr/x404, 404x/, 'tries');
122 like(http_get('/tries/backup'), qr/x404, 404x/, 'tries backup'); 122 like(http_get('/tries/backup'), qr/x404, 404x/, 'tries backup');