comparison uwsgi.t @ 802:eca9b1d19021

Tests: tests for host expansion to an explicit upstream.
author Sergey Kandaurov <pluknet@nginx.com>
date Wed, 09 Dec 2015 19:00:41 +0300
parents d95c4b8e5517
children e9064d691790
comparison
equal deleted inserted replaced
801:d95c4b8e5517 802:eca9b1d19021
19 ############################################################################### 19 ###############################################################################
20 20
21 select STDERR; $| = 1; 21 select STDERR; $| = 1;
22 select STDOUT; $| = 1; 22 select STDOUT; $| = 1;
23 23
24 my $t = Test::Nginx->new()->has(qw/http uwsgi/)->has_daemon('uwsgi')->plan(4) 24 my $t = Test::Nginx->new()->has(qw/http uwsgi/)->has_daemon('uwsgi')->plan(5)
25 ->write_file_expand('nginx.conf', <<'EOF'); 25 ->write_file_expand('nginx.conf', <<'EOF');
26 26
27 %%TEST_GLOBALS%% 27 %%TEST_GLOBALS%%
28 28
29 daemon off; 29 daemon off;
31 events { 31 events {
32 } 32 }
33 33
34 http { 34 http {
35 %%TEST_GLOBALS_HTTP%% 35 %%TEST_GLOBALS_HTTP%%
36
37 upstream u {
38 server 127.0.0.1:8081;
39 }
36 40
37 server { 41 server {
38 listen 127.0.0.1:8080; 42 listen 127.0.0.1:8080;
39 server_name localhost; 43 server_name localhost;
40 44
85 89
86 like(http_get_headers('/headers'), qr/SEE-THIS/, 90 like(http_get_headers('/headers'), qr/SEE-THIS/,
87 'uwsgi request with many ignored headers'); 91 'uwsgi request with many ignored headers');
88 92
89 like(http_get('/var?b=127.0.0.1:8081'), qr/SEE-THIS/, 'uwsgi with variables'); 93 like(http_get('/var?b=127.0.0.1:8081'), qr/SEE-THIS/, 'uwsgi with variables');
94 like(http_get('/var?b=u'), qr/SEE-THIS/, 'uwsgi with variables to upstream');
90 95
91 ############################################################################### 96 ###############################################################################
92 97
93 sub http_get_headers { 98 sub http_get_headers {
94 my ($url, %extra) = @_; 99 my ($url, %extra) = @_;