Mercurial > hg > nginx-tests
comparison proxy_protocol2_tlv.t @ 1801:f129b693d83e
Tests: skip proxy_protocol2_tlv.t for nginx stable.
It fails with the nginx 1.22.1 due to lack of support $proxy_protocol_tlv_*
variables.
author | Eugene Grebenschikov <e.grebenshchikov@f5.com> |
---|---|
date | Wed, 26 Oct 2022 13:29:19 -0700 |
parents | 074974eb9182 |
children | 506e1a716fe8 |
comparison
equal
deleted
inserted
replaced
1800:074974eb9182 | 1801:f129b693d83e |
---|---|
21 ############################################################################### | 21 ############################################################################### |
22 | 22 |
23 select STDERR; $| = 1; | 23 select STDERR; $| = 1; |
24 select STDOUT; $| = 1; | 24 select STDOUT; $| = 1; |
25 | 25 |
26 my $t = Test::Nginx->new()->has(qw/http access rewrite/)->plan(15) | 26 my $t = Test::Nginx->new()->has(qw/http access rewrite/) |
27 ->write_file_expand('nginx.conf', <<'EOF'); | 27 ->write_file_expand('nginx.conf', <<'EOF'); |
28 | 28 |
29 %%TEST_GLOBALS%% | 29 %%TEST_GLOBALS%% |
30 | 30 |
31 daemon off; | 31 daemon off; |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 EOF | 80 EOF |
81 | 81 |
82 plan(skip_all => 'not yet') unless $t->has_version('1.23.2'); | |
83 $t->plan(15); | |
84 | |
82 $t->run(); | 85 $t->run(); |
83 | 86 |
84 ############################################################################### | 87 ############################################################################### |
85 | 88 |
86 my $p = pack("N3C", 0x0D0A0D0A, 0x000D0A51, 0x5549540A, 0x21); | 89 my $p = pack("N3C", 0x0D0A0D0A, 0x000D0A51, 0x5549540A, 0x21); |
111 0x3000054e, 0x45544e53, | 114 0x3000054e, 0x45544e53, |
112 # 0xae custom | 115 # 0xae custom |
113 0xae000531, 0x32333435); | 116 0xae000531, 0x32333435); |
114 my $r; | 117 my $r; |
115 | 118 |
116 TODO: { | |
117 local $TODO = 'not yet' unless $t->has_version('1.23.2'); | |
118 | |
119 $r = pp_get('/t1', $tlv); | 119 $r = pp_get('/t1', $tlv); |
120 like($r, qr/X-ALPN: ALPN1-ALPN1\x0d/, 'ALPN - tlv named variable'); | 120 like($r, qr/X-ALPN: ALPN1-ALPN1\x0d/, 'ALPN - tlv named variable'); |
121 like($r, qr/X-AUTHORITY: localhost-localhost\x0d/, | 121 like($r, qr/X-AUTHORITY: localhost-localhost\x0d/, |
122 'AUTHORITY - tlv named variable'); | 122 'AUTHORITY - tlv named variable'); |
123 like($r, qr/X-UNIQUE-ID: UNIQQ-UNIQQ\x0d/, 'UNIQUE_ID - tlv named variable'); | 123 like($r, qr/X-UNIQUE-ID: UNIQQ-UNIQQ\x0d/, 'UNIQUE_ID - tlv named variable'); |
137 like($r, qr/X-TLV-CRC32C: 43210\x0d/, 'CRC32C - tlv numeric variable'); | 137 like($r, qr/X-TLV-CRC32C: 43210\x0d/, 'CRC32C - tlv numeric variable'); |
138 like($r, qr/X-TLV-CUSTOM: 12345\x0d/, | 138 like($r, qr/X-TLV-CUSTOM: 12345\x0d/, |
139 'custom - tlv numeric variable'); | 139 'custom - tlv numeric variable'); |
140 like($r, qr/X-TLV-X: -\x0d/, 'non-existent - tlv numeric variable'); | 140 like($r, qr/X-TLV-X: -\x0d/, 'non-existent - tlv numeric variable'); |
141 | 141 |
142 } | |
143 | |
144 ############################################################################### | 142 ############################################################################### |
145 | 143 |
146 sub pp_get { | 144 sub pp_get { |
147 my ($url, $proxy) = @_; | 145 my ($url, $proxy) = @_; |
148 return http($proxy . <<EOF); | 146 return http($proxy . <<EOF); |