Mercurial > hg > nginx-tests
diff proxy_cookie.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 | 847ea345becb |
children | 882267679006 |
line wrap: on
line diff
--- a/proxy_cookie.t +++ b/proxy_cookie.t @@ -37,11 +37,11 @@ http { %%TEST_GLOBALS_HTTP%% server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; location / { - proxy_pass http://127.0.0.1:8081; + proxy_pass http://127.0.0.1:%%PORT_1%%; proxy_cookie_domain www.example.org .example.com; proxy_cookie_domain .$server_name.com en.$server_name.org; @@ -55,7 +55,7 @@ http { } server { - listen 127.0.0.1:8081; + listen 127.0.0.1:%%PORT_1%%; server_name localhost; location / { @@ -77,6 +77,8 @@ EOF ############################################################################### +my $port = port(0); + is(http_get_set_cookie('/?domain=www.Example.org'), 'v=path=domain=; Domain=example.com', 'domain rewrite'); is(http_get_set_cookie('/?domain=.LocalHost.com'), @@ -103,7 +105,7 @@ is(http_get_set_cookie('/?domain=www.exa sub http_get_set_cookie { my ($uri) = @_; - http_get("http://127.0.0.1:8080$uri") =~ /^Set-Cookie:\s(.+?)\x0d?$/mi; + http_get("http://127.0.0.1:$port$uri") =~ /^Set-Cookie:\s(.+?)\x0d?$/mi; return $1; }