Mercurial > hg > nginx-tests
annotate grpc_next_upstream.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 11463d379570 |
children |
rev | line source |
---|---|
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
3 # (C) Maxim Dounin |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
4 # (C) Sergey Kandaurov |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
5 # (C) Nginx, Inc. |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
6 |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
7 # Tests for grpc module, grpc_next_upstream directive. |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 ############################################################################### |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 use warnings; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 use strict; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 use Test::More; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 BEGIN { use FindBin; chdir($FindBin::Bin); } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 use lib 'lib'; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 use Test::Nginx; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 ############################################################################### |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 select STDERR; $| = 1; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 select STDOUT; $| = 1; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
1381
97c8280de681
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1311
diff
changeset
|
26 my $t = Test::Nginx->new()->has(qw/http http_v2 grpc rewrite/)->plan(9); |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 $t->write_file_expand('nginx.conf', <<'EOF'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 %%TEST_GLOBALS%% |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 daemon off; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 events { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 http { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 %%TEST_GLOBALS_HTTP%% |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 upstream u { |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
41 server 127.0.0.1:8081 max_fails=2; |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
42 server 127.0.0.1:8082; |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
45 upstream u2 { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
46 server 127.0.0.1:8081; |
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
47 server 127.0.0.1:8082; |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
48 } |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
49 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
51 listen 127.0.0.1:8080; |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 server_name localhost; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 location / { |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
55 grpc_pass u; |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
56 grpc_next_upstream http_500 http_404 invalid_header; |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
57 } |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
58 |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
59 location /all/ { |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
60 grpc_pass u2; |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
61 grpc_next_upstream http_500 http_404; |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
62 error_page 404 /all/404; |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
63 grpc_intercept_errors on; |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
64 } |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
65 |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
66 location /all/404 { |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
67 return 200 "$upstream_addr\n"; |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
68 } |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
71 server { |
1986
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
72 listen 127.0.0.1:8081; |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
73 server_name localhost; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
74 |
1986
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
75 http2 on; |
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
76 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 location / { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 return 404; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
80 location /ok { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 return 200 "AND-THIS\n"; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 location /500 { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 return 500; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 } |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
86 location /444 { |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
87 return 444; |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
88 } |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
89 |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
90 location /all/ { |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
91 return 404; |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
92 } |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
93 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
94 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
95 server { |
1986
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
96 listen 127.0.0.1:8082; |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
97 server_name localhost; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
98 |
1986
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
99 http2 on; |
11463d379570
Tests: reworked HTTP/2 tests to use "http2 on".
Maxim Dounin <mdounin@mdounin.ru>
parents:
1900
diff
changeset
|
100 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 location / { |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 return 200 "TEST-OK-IF-YOU-SEE-THIS\n"; |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
103 } |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
104 |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
105 location /all/ { |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
106 return 404; |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
107 } |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 } |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
110 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
111 EOF |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
112 |
1381
97c8280de681
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1311
diff
changeset
|
113 $t->run(); |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
114 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
115 ############################################################################### |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
116 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
117 my ($p1, $p2) = (port(8081), port(8082)); |
952
e9064d691790
Tests: converted tests to run in parallel.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
351
diff
changeset
|
118 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 # check if both request fallback to a backend |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
120 # which returns valid response |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
122 like(http_get('/'), qr/SEE-THIS/, 'grpc request'); |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
123 like(http_get('/'), qr/SEE-THIS/, 'second request'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
125 # make sure backend isn't switched off after |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
126 # grpc_next_upstream http_404 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 like(http_get('/ok') . http_get('/ok'), qr/AND-THIS/, 'not down'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 |
1311
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
130 # next upstream on invalid_header |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
131 |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
132 like(http_get('/444'), qr/SEE-THIS/, 'request 444'); |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
133 like(http_get('/444'), qr/SEE-THIS/, 'request 444 second'); |
4979af9fd905
Tests: grpc request buffering and next upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
974
diff
changeset
|
134 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 # next upstream on http_500 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 like(http_get('/500'), qr/SEE-THIS/, 'request 500'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
138 like(http_get('/500'), qr/SEE-THIS/, 'request 500 second'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
139 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
140 # make sure backend switched off with http_500 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 unlike(http_get('/ok') . http_get('/ok'), qr/AND-THIS/, 'down after 500'); |
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
143 |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
144 # make sure all backends are tried once |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
145 |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
146 like(http_get('/all/rr'), |
952
e9064d691790
Tests: converted tests to run in parallel.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
351
diff
changeset
|
147 qr/^127.0.0.1:($p1, 127.0.0.1:$p2|$p2, 127.0.0.1:$p1)$/mi, |
351
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
148 'all tried once'); |
3d3c8b5ea8ee
Tests: improved proxy_next_upstream tests.
Sergey Kandaurov <pluknet@nginx.com>
parents:
288
diff
changeset
|
149 |
288
56157712d744
Tests: proxy_next_upstream tests.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
150 ############################################################################### |