comparison stream_limit_conn_complex.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 3ac72d59430b
children 196d33c2bb45
comparison
equal deleted inserted replaced
973:7d7aef8b9f3a 974:882267679006
34 34
35 stream { 35 stream {
36 limit_conn_zone $binary_remote_addr$server_port zone=zone:1m; 36 limit_conn_zone $binary_remote_addr$server_port zone=zone:1m;
37 37
38 server { 38 server {
39 listen 127.0.0.1:%%PORT_0%%; 39 listen 127.0.0.1:8080;
40 proxy_pass 127.0.0.1:%%PORT_4%%; 40 proxy_pass 127.0.0.1:8084;
41 limit_conn zone 1; 41 limit_conn zone 1;
42 } 42 }
43 43
44 server { 44 server {
45 listen 127.0.0.1:%%PORT_1%%; 45 listen 127.0.0.1:8081;
46 proxy_pass 127.0.0.1:%%PORT_4%%; 46 proxy_pass 127.0.0.1:8084;
47 limit_conn zone 1; 47 limit_conn zone 1;
48 } 48 }
49 } 49 }
50 50
51 http { 51 http {
52 %%TEST_GLOBALS_HTTP%% 52 %%TEST_GLOBALS_HTTP%%
53 53
54 server { 54 server {
55 listen 127.0.0.1:%%PORT_4%%; 55 listen 127.0.0.1:8084;
56 server_name localhost; 56 server_name localhost;
57 57
58 location / { } 58 location / { }
59 } 59 }
60 } 60 }
64 $t->write_file('index.html', ''); 64 $t->write_file('index.html', '');
65 $t->try_run('no stream limit_conn with complex value')->plan(4); 65 $t->try_run('no stream limit_conn with complex value')->plan(4);
66 66
67 ############################################################################### 67 ###############################################################################
68 68
69 like(get(port(0)), qr/200 OK/, 'passed'); 69 like(get(port(8080)), qr/200 OK/, 'passed');
70 70
71 my $s = http(<<EOF, start => 1, sleep => 0.2); 71 my $s = http(<<EOF, start => 1, sleep => 0.2);
72 GET / HTTP/1.0 72 GET / HTTP/1.0
73 EOF 73 EOF
74 74
75 ok($s, 'long connection'); 75 ok($s, 'long connection');
76 76
77 is(get(port(0)), undef, 'rejected same key'); 77 is(get(port(8080)), undef, 'rejected same key');
78 like(get(port(1)), qr/200 OK/, 'passed different key'); 78 like(get(port(8081)), qr/200 OK/, 'passed different key');
79 79
80 ############################################################################### 80 ###############################################################################
81 81
82 sub get { 82 sub get {
83 my $port = shift; 83 my $port = shift;