Mercurial > hg > nginx-tests
annotate proxy_variables.t @ 1990:85d88cd5091c
Tests: SSI include stub tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Jul 2024 17:42:55 +0300 |
parents | 144c6ce732e4 |
children |
rev | line source |
---|---|
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Sergey Kandaurov |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 # Tests for http proxy module with upstream variables. |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 ############################################################################### |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 use warnings; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use strict; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use Test::More; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 BEGIN { use FindBin; chdir($FindBin::Bin); } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 use lib 'lib'; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 use Test::Nginx; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 ############################################################################### |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 select STDERR; $| = 1; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 select STDOUT; $| = 1; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 |
1535
144c6ce732e4
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1419
diff
changeset
|
25 my $t = Test::Nginx->new()->has(qw/http proxy/)->plan(4) |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 ->write_file_expand('nginx.conf', <<'EOF'); |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 %%TEST_GLOBALS%% |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 daemon off; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 events { |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 http { |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 %%TEST_GLOBALS_HTTP%% |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
38 log_format u $uri:$upstream_response_length:$upstream_bytes_received: |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
39 $upstream_bytes_sent:$upstream_http_x_len; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 server { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
42 listen 127.0.0.1:8080; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 server_name localhost; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 location / { |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
46 proxy_pass http://127.0.0.1:8081; |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
47 access_log %%TESTDIR%%/test.log u; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 EOF |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
54 $t->run_daemon(\&http_daemon, port(8081)); |
1535
144c6ce732e4
Tests: removed TODO and try_run() checks for legacy versions.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1419
diff
changeset
|
55 $t->run(); |
586
ef2b435c1048
Tests: simple tests for $upstream_connect_time.
Sergey Kandaurov <pluknet@nginx.com>
parents:
568
diff
changeset
|
56 |
974
882267679006
Tests: simplified parallel modifications in tests.
Andrey Zelenkov <zelenkov@nginx.com>
parents:
952
diff
changeset
|
57 $t->waitforsocket('127.0.0.1:' . port(8081)); |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 ############################################################################### |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
60 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
61 my $r; |
1403
3783b937a1dc
Tests: added upstream response time tests with client close.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1402
diff
changeset
|
62 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
63 my ($l1) = ($r = http_get('/')) =~ /X-Len: (\d+)/; |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
64 like($r, qr/SEE-THIS/, 'proxy request'); |
1401
2b461d4af65f
Tests: adjusted upstream response time tests for upcoming changes.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1291
diff
changeset
|
65 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
66 my ($l2) = ($r = http_get('/multi')) =~ /X-Len: (\d+)/; |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
67 like($r, qr/AND-THIS/, 'proxy request with multiple packets'); |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
68 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
69 $t->stop(); |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
70 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
71 my $f = $t->read_file('test.log'); |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
72 Test::Nginx::log_core('||', $f); |
1410
a1a3164faec8
Tests: harden proxy_variables.t, avoid uninitialized warnings.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1403
diff
changeset
|
73 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
74 like($f, qr!^/:23:68:$l1:$l1!m, 'log - response length'); |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
75 like($f, qr!^/multi:32:77:$l2:$l2!m, 'log - response length - multi packets'); |
1403
3783b937a1dc
Tests: added upstream response time tests with client close.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1402
diff
changeset
|
76 |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
77 ############################################################################### |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
78 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
79 sub http_daemon { |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
80 my ($port) = @_; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
81 my $server = IO::Socket::INET->new( |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
82 Proto => 'tcp', |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
83 LocalHost => '127.0.0.1', |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
84 LocalPort => $port, |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
85 Listen => 5, |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
86 Reuse => 1 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
87 ) |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
88 or die "Can't create listening socket: $!\n"; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
89 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
90 local $SIG{PIPE} = 'IGNORE'; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
91 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
92 while (my $client = $server->accept()) { |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
93 $client->autoflush(1); |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
94 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
95 my $headers = ''; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
96 my $uri = ''; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
97 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
98 while (<$client>) { |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
99 $headers .= $_; |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
100 last if (/^\x0d?\x0a?$/); |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
101 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
102 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
103 $uri = $1 if $headers =~ /^\S+\s+([^ ]+)\s+HTTP/i; |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
104 my $len = length($headers); |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
105 |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
106 if ($uri eq '/') { |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
107 print $client <<"EOF"; |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
108 HTTP/1.1 200 OK |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
109 Connection: close |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
110 X-Len: $len |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
111 |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
112 EOF |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
113 print $client "TEST-OK-IF-YOU-SEE-THIS" |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
114 unless $headers =~ /^HEAD/i; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
115 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
116 } elsif ($uri eq '/multi') { |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
117 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
118 print $client <<"EOF"; |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
119 HTTP/1.1 200 OK |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
120 Connection: close |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
121 X-Len: $len |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
122 |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
123 TEST-OK-IF-YOU-SEE-THIS |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
124 EOF |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
125 |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
126 select undef, undef, undef, 0.1; |
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
127 print $client 'AND-THIS'; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
128 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
129 |
1419
16a8962ff246
Tests: upstream_response_length_variable tests, proxy.t merged.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1410
diff
changeset
|
130 close $client; |
520
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
131 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
132 } |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
133 |
4bcf8bc2bafe
Tests: $upstream_header_time and $upstream_response_time variables.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
134 ############################################################################### |