Mercurial > hg > nginx-tests
comparison uwsgi.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 | d23d959713b5 |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
33 | 33 |
34 http { | 34 http { |
35 %%TEST_GLOBALS_HTTP%% | 35 %%TEST_GLOBALS_HTTP%% |
36 | 36 |
37 upstream u { | 37 upstream u { |
38 server 127.0.0.1:%%PORT_1%%; | 38 server 127.0.0.1:8081; |
39 } | 39 } |
40 | 40 |
41 server { | 41 server { |
42 listen 127.0.0.1:%%PORT_0%%; | 42 listen 127.0.0.1:8080; |
43 server_name localhost; | 43 server_name localhost; |
44 | 44 |
45 location / { | 45 location / { |
46 uwsgi_pass 127.0.0.1:%%PORT_1%%; | 46 uwsgi_pass 127.0.0.1:8081; |
47 uwsgi_param SERVER_PROTOCOL $server_protocol; | 47 uwsgi_param SERVER_PROTOCOL $server_protocol; |
48 uwsgi_param HTTP_X_BLAH "blah"; | 48 uwsgi_param HTTP_X_BLAH "blah"; |
49 } | 49 } |
50 | 50 |
51 location /var { | 51 location /var { |
71 if ($uwsgihelp !~ /--wsgi-file/) { | 71 if ($uwsgihelp !~ /--wsgi-file/) { |
72 # uwsgi has no python support, maybe plugin load is necessary | 72 # uwsgi has no python support, maybe plugin load is necessary |
73 push @uwsgiopts, '--plugin', 'python'; | 73 push @uwsgiopts, '--plugin', 'python'; |
74 } | 74 } |
75 | 75 |
76 $t->run_daemon('uwsgi', '--socket', '127.0.0.1:' . port(1), @uwsgiopts, | 76 $t->run_daemon('uwsgi', '--socket', '127.0.0.1:' . port(8081), @uwsgiopts, |
77 '--wsgi-file', $t->testdir() . '/uwsgi_test_app.py', | 77 '--wsgi-file', $t->testdir() . '/uwsgi_test_app.py', |
78 '--logto', $t->testdir() . '/uwsgi_log'); | 78 '--logto', $t->testdir() . '/uwsgi_log'); |
79 | 79 |
80 $t->run(); | 80 $t->run(); |
81 | 81 |
82 $t->waitforsocket('127.0.0.1:' . port(1)) | 82 $t->waitforsocket('127.0.0.1:' . port(8081)) |
83 or die "Can't start uwsgi"; | 83 or die "Can't start uwsgi"; |
84 | 84 |
85 ############################################################################### | 85 ############################################################################### |
86 | 86 |
87 like(http_get('/'), qr/SEE-THIS/, 'uwsgi request'); | 87 like(http_get('/'), qr/SEE-THIS/, 'uwsgi request'); |
88 unlike(http_head('/head'), qr/SEE-THIS/, 'no data in HEAD'); | 88 unlike(http_head('/head'), qr/SEE-THIS/, 'no data in HEAD'); |
89 | 89 |
90 like(http_get_headers('/headers'), qr/SEE-THIS/, | 90 like(http_get_headers('/headers'), qr/SEE-THIS/, |
91 'uwsgi request with many ignored headers'); | 91 'uwsgi request with many ignored headers'); |
92 | 92 |
93 like(http_get('/var?b=127.0.0.1:' . port(1)), qr/SEE-THIS/, | 93 like(http_get('/var?b=127.0.0.1:' . port(8081)), qr/SEE-THIS/, |
94 'uwsgi with variables'); | 94 'uwsgi with variables'); |
95 like(http_get('/var?b=u'), qr/SEE-THIS/, 'uwsgi with variables to upstream'); | 95 like(http_get('/var?b=u'), qr/SEE-THIS/, 'uwsgi with variables to upstream'); |
96 | 96 |
97 ############################################################################### | 97 ############################################################################### |
98 | 98 |