comparison proxy_next_upstream_tries.t @ 568:907e89fba9c3

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Sun, 03 May 2015 12:45:09 +0300
parents 623863fcb1d1
children ef1c363dd648
comparison
equal deleted inserted replaced
567:22bade4c7e12 568:907e89fba9c3
21 ############################################################################### 21 ###############################################################################
22 22
23 select STDERR; $| = 1; 23 select STDERR; $| = 1;
24 select STDOUT; $| = 1; 24 select STDOUT; $| = 1;
25 25
26 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/); 26 my $t = Test::Nginx->new()->has(qw/http proxy rewrite/)->plan(8);
27 27
28 $t->write_file_expand('nginx.conf', <<'EOF'); 28 $t->write_file_expand('nginx.conf', <<'EOF');
29 29
30 %%TEST_GLOBALS%% 30 %%TEST_GLOBALS%%
31 31
111 111
112 EOF 112 EOF
113 113
114 $t->run_daemon(\&http_daemon, 8081); 114 $t->run_daemon(\&http_daemon, 8081);
115 $t->run_daemon(\&dns_daemon, 8083, $t); 115 $t->run_daemon(\&dns_daemon, 8083, $t);
116 $t->try_run('no proxy_next_upstream_tries')->plan(8); 116 $t->run();
117 117
118 $t->waitforsocket('127.0.0.1:8081'); 118 $t->waitforsocket('127.0.0.1:8081');
119 $t->waitforfile($t->testdir . '/8083'); 119 $t->waitforfile($t->testdir . '/8083');
120 120
121 ############################################################################### 121 ###############################################################################
122 122
123 like(http_get('/tries'), qr/x404, 404x/, 'tries'); 123 like(http_get('/tries'), qr/x404, 404x/, 'tries');
124 like(http_get('/tries/backup'), qr/x404, 404x/, 'tries backup'); 124 like(http_get('/tries/backup'), qr/x404, 404x/, 'tries backup');
125
126 TODO: {
127 local $TODO = 'not yet' unless $t->has_version('1.7.7');
128
129 like(http_get('/tries/resolver'), qr/x404, 404x/, 'tries resolved'); 125 like(http_get('/tries/resolver'), qr/x404, 404x/, 'tries resolved');
130
131 }
132
133 like(http_get('/tries/zero'), qr/x404, 404, 404x/, 'tries zero'); 126 like(http_get('/tries/zero'), qr/x404, 404, 404x/, 'tries zero');
134 127
135 # two tries fit into 1.9s 128 # two tries fit into 1.9s
136 129
137 like(http_get('/timeout'), qr/x404, 404x/, 'timeout'); 130 like(http_get('/timeout'), qr/x404, 404x/, 'timeout');
138 like(http_get('/timeout/backup'), qr/x404, 404x/, 'timeout backup'); 131 like(http_get('/timeout/backup'), qr/x404, 404x/, 'timeout backup');
139
140 TODO: {
141 local $TODO = 'not yet' unless $t->has_version('1.7.7');
142
143 like(http_get('/timeout/resolver'), qr/x404, 404x/, 'timeout resolved'); 132 like(http_get('/timeout/resolver'), qr/x404, 404x/, 'timeout resolved');
144
145 }
146
147 like(http_get('/timeout/zero'), qr/x404, 404, 404x/, 'timeout zero'); 133 like(http_get('/timeout/zero'), qr/x404, 404, 404x/, 'timeout zero');
148 134
149 ############################################################################### 135 ###############################################################################
150 136
151 sub http_daemon { 137 sub http_daemon {