Mercurial > hg > nginx-tests
comparison stream_proxy_ssl_name.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 | 8ef51dbb5d69 |
comparison
equal
deleted
inserted
replaced
973:7d7aef8b9f3a | 974:882267679006 |
---|---|
38 stream { | 38 stream { |
39 proxy_ssl on; | 39 proxy_ssl on; |
40 proxy_ssl_session_reuse off; | 40 proxy_ssl_session_reuse off; |
41 | 41 |
42 upstream u { | 42 upstream u { |
43 server 127.0.0.1:%%PORT_5%%; | 43 server 127.0.0.1:8085; |
44 } | 44 } |
45 | 45 |
46 server { | 46 server { |
47 listen 127.0.0.1:%%PORT_0%%; | 47 listen 127.0.0.1:8080; |
48 proxy_pass u; | 48 proxy_pass u; |
49 | 49 |
50 proxy_ssl_server_name off; | 50 proxy_ssl_server_name off; |
51 } | 51 } |
52 | 52 |
53 server { | 53 server { |
54 listen 127.0.0.1:%%PORT_1%%; | 54 listen 127.0.0.1:8081; |
55 proxy_pass u; | 55 proxy_pass u; |
56 | 56 |
57 proxy_ssl_server_name on; | 57 proxy_ssl_server_name on; |
58 } | 58 } |
59 | 59 |
60 server { | 60 server { |
61 listen 127.0.0.1:%%PORT_2%%; | 61 listen 127.0.0.1:8082; |
62 proxy_pass 127.0.0.1:%%PORT_5%%; | 62 proxy_pass 127.0.0.1:8085; |
63 | 63 |
64 proxy_ssl_server_name on; | 64 proxy_ssl_server_name on; |
65 proxy_ssl_name example.com; | 65 proxy_ssl_name example.com; |
66 } | 66 } |
67 | 67 |
68 server { | 68 server { |
69 listen 127.0.0.1:%%PORT_3%%; | 69 listen 127.0.0.1:8083; |
70 proxy_pass 127.0.0.1:%%PORT_5%%; | 70 proxy_pass 127.0.0.1:8085; |
71 | 71 |
72 proxy_ssl_server_name on; | 72 proxy_ssl_server_name on; |
73 } | 73 } |
74 | 74 |
75 server { | 75 server { |
76 listen 127.0.0.1:%%PORT_4%%; | 76 listen 127.0.0.1:8084; |
77 proxy_pass 127.0.0.1:%%PORT_5%%; | 77 proxy_pass 127.0.0.1:8085; |
78 | 78 |
79 proxy_ssl_server_name on; | 79 proxy_ssl_server_name on; |
80 proxy_ssl_name example.com:123; | 80 proxy_ssl_name example.com:123; |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 http { | 84 http { |
85 %%TEST_GLOBALS_HTTP%% | 85 %%TEST_GLOBALS_HTTP%% |
86 | 86 |
87 server { | 87 server { |
88 listen 127.0.0.1:%%PORT_5%% ssl; | 88 listen 127.0.0.1:8085 ssl; |
89 server_name localhost; | 89 server_name localhost; |
90 | 90 |
91 ssl_certificate_key localhost.key; | 91 ssl_certificate_key localhost.key; |
92 ssl_certificate localhost.crt; | 92 ssl_certificate localhost.crt; |
93 | 93 |
122 $t->run(); | 122 $t->run(); |
123 | 123 |
124 ############################################################################### | 124 ############################################################################### |
125 | 125 |
126 like(http_get('/'), qr/200 OK.*X-Name: ,/s, 'no name'); | 126 like(http_get('/'), qr/200 OK.*X-Name: ,/s, 'no name'); |
127 like(http_get('/', socket => getconn('127.0.0.1:' . port(1))), | 127 like(http_get('/', socket => getconn('127.0.0.1:' . port(8081))), |
128 qr/200 OK.*X-Name: u,/s, 'name default'); | 128 qr/200 OK.*X-Name: u,/s, 'name default'); |
129 like(http_get('/', socket => getconn('127.0.0.1:' . port(2))), | 129 like(http_get('/', socket => getconn('127.0.0.1:' . port(8082))), |
130 qr/200 OK.*X-Name: example.com,/s, 'name override'); | 130 qr/200 OK.*X-Name: example.com,/s, 'name override'); |
131 like(http_get('/', socket => getconn('127.0.0.1:' . port(3))), | 131 like(http_get('/', socket => getconn('127.0.0.1:' . port(8083))), |
132 qr/200 OK.*X-Name: ,/s, 'no ip'); | 132 qr/200 OK.*X-Name: ,/s, 'no ip'); |
133 like(http_get('/', socket => getconn('127.0.0.1:' . port(4))), | 133 like(http_get('/', socket => getconn('127.0.0.1:' . port(8084))), |
134 qr/200 OK.*X-Name: example.com,/s, 'no port in name'); | 134 qr/200 OK.*X-Name: example.com,/s, 'no port in name'); |
135 | 135 |
136 ############################################################################### | 136 ############################################################################### |
137 | 137 |
138 sub getconn { | 138 sub getconn { |