comparison uwsgi.t @ 952:e9064d691790

Tests: converted tests to run in parallel.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 21 Jun 2016 16:39:13 +0300
parents eca9b1d19021
children 882267679006
comparison
equal deleted inserted replaced
951:9361c7eddfc1 952:e9064d691790
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:8081; 38 server 127.0.0.1:%%PORT_1%%;
39 } 39 }
40 40
41 server { 41 server {
42 listen 127.0.0.1:8080; 42 listen 127.0.0.1:%%PORT_0%%;
43 server_name localhost; 43 server_name localhost;
44 44
45 location / { 45 location / {
46 uwsgi_pass 127.0.0.1:8081; 46 uwsgi_pass 127.0.0.1:%%PORT_1%%;
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:8081', @uwsgiopts, 76 $t->run_daemon('uwsgi', '--socket', '127.0.0.1:' . port(1), @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:8081') 82 $t->waitforsocket('127.0.0.1:' . port(1))
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:8081'), qr/SEE-THIS/, 'uwsgi with variables'); 93 like(http_get('/var?b=127.0.0.1:' . port(1)), qr/SEE-THIS/,
94 'uwsgi with variables');
94 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');
95 96
96 ############################################################################### 97 ###############################################################################
97 98
98 sub http_get_headers { 99 sub http_get_headers {