Mercurial > hg > nginx-tests
comparison proxy_pass_request.t @ 974:882267679006
Tests: simplified parallel modifications in tests.
Mail tests were simplified in c227348453db.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 12 Jul 2016 17:39:03 +0300 |
parents | e9064d691790 |
children |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
35 | 35 |
36 http { | 36 http { |
37 %%TEST_GLOBALS_HTTP%% | 37 %%TEST_GLOBALS_HTTP%% |
38 | 38 |
39 server { | 39 server { |
40 listen 127.0.0.1:%%PORT_0%%; | 40 listen 127.0.0.1:8080; |
41 server_name localhost; | 41 server_name localhost; |
42 | 42 |
43 proxy_pass_request_headers off; | 43 proxy_pass_request_headers off; |
44 | 44 |
45 location / { | 45 location / { |
46 proxy_pass http://127.0.0.1:%%PORT_1%%; | 46 proxy_pass http://127.0.0.1:8081; |
47 } | 47 } |
48 | 48 |
49 location /body { | 49 location /body { |
50 proxy_pass http://127.0.0.1:%%PORT_1%%; | 50 proxy_pass http://127.0.0.1:8081; |
51 proxy_pass_request_headers on; | 51 proxy_pass_request_headers on; |
52 proxy_pass_request_body off; | 52 proxy_pass_request_body off; |
53 } | 53 } |
54 | 54 |
55 location /both { | 55 location /both { |
56 proxy_pass http://127.0.0.1:%%PORT_1%%; | 56 proxy_pass http://127.0.0.1:8081; |
57 proxy_pass_request_headers off; | 57 proxy_pass_request_headers off; |
58 proxy_pass_request_body off; | 58 proxy_pass_request_body off; |
59 } | 59 } |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 EOF | 63 EOF |
64 | 64 |
65 $t->run_daemon(\&http_daemon); | 65 $t->run_daemon(\&http_daemon); |
66 $t->run()->waitforsocket('127.0.0.1:' . port(1)); | 66 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); |
67 | 67 |
68 ############################################################################### | 68 ############################################################################### |
69 | 69 |
70 like(get('/', 'foo', 'bar'), qr/Header: none.*Body: bar/s, 'no headers'); | 70 like(get('/', 'foo', 'bar'), qr/Header: none.*Body: bar/s, 'no headers'); |
71 like(get('/body', 'foo', 'bar'), qr/Header: foo.*Body: none/s, 'no body'); | 71 like(get('/body', 'foo', 'bar'), qr/Header: foo.*Body: none/s, 'no body'); |
88 } | 88 } |
89 | 89 |
90 sub http_daemon { | 90 sub http_daemon { |
91 my $server = IO::Socket::INET->new( | 91 my $server = IO::Socket::INET->new( |
92 Proto => 'tcp', | 92 Proto => 'tcp', |
93 LocalHost => '127.0.0.1:' . port(1), | 93 LocalHost => '127.0.0.1:' . port(8081), |
94 Listen => 5, | 94 Listen => 5, |
95 Reuse => 1 | 95 Reuse => 1 |
96 ) | 96 ) |
97 or die "Can't create listening socket: $!\n"; | 97 or die "Can't create listening socket: $!\n"; |
98 | 98 |