comparison proxy_extra_data.t @ 1693:5ac6efbe5552

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 01 Jun 2021 16:40:18 +0300
parents 6c323c672a86
children
comparison
equal deleted inserted replaced
1692:f6795e2e6a4b 1693:5ac6efbe5552
72 $t->run_daemon(\&http_daemon); 72 $t->run_daemon(\&http_daemon);
73 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); 73 $t->run()->waitforsocket('127.0.0.1:' . port(8081));
74 74
75 ############################################################################### 75 ###############################################################################
76 76
77 TODO: {
78 local $TODO = 'not yet' unless $t->has_version('1.19.1');
79
80 like(http_get('/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 'response with extra data'); 77 like(http_get('/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 'response with extra data');
81
82 }
83
84 like(http_get('/short'), qr/SEE-THIS(?!.*:after)/s, 'too short response'); 78 like(http_get('/short'), qr/SEE-THIS(?!.*:after)/s, 'too short response');
85 like(http_get('/empty'), qr/200 OK(?!.*:after)/s, 'empty too short response'); 79 like(http_get('/empty'), qr/200 OK(?!.*:after)/s, 'empty too short response');
86 80
87 like(http_head('/'), qr/200 OK(?!.*SEE-THIS)/s, 'no data in HEAD'); 81 like(http_head('/'), qr/200 OK(?!.*SEE-THIS)/s, 'no data in HEAD');
88 like(http_head('/short'), qr/200 OK(?!.*SEE-THIS)/s, 'too short to HEAD'); 82 like(http_head('/short'), qr/200 OK(?!.*SEE-THIS)/s, 'too short to HEAD');
89 like(http_head('/empty'), qr/200 OK/, 'empty response to HEAD'); 83 like(http_head('/empty'), qr/200 OK/, 'empty response to HEAD');
90 84
91 # unbuffered responses 85 # unbuffered responses
92 86
93 TODO: {
94 local $TODO = 'not yet' unless $t->has_version('1.19.1');
95
96 like(http_get('/unbuf/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 87 like(http_get('/unbuf/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/,
97 'unbuffered with extra data'); 88 'unbuffered with extra data');
98
99 }
100
101 like(http_get('/unbuf/short'), qr/SEE-THIS(?!.*:after)/s, 89 like(http_get('/unbuf/short'), qr/SEE-THIS(?!.*:after)/s,
102 'unbuffered too short response'); 90 'unbuffered too short response');
103 like(http_get('/unbuf/empty'), qr/200 OK(?!.*:after)/s, 91 like(http_get('/unbuf/empty'), qr/200 OK(?!.*:after)/s,
104 'unbuffered empty too short response'); 92 'unbuffered empty too short response');
105 93
117 like(http_head('/head/extra'), qr/200 OK(?!.*SEE-THIS)/s, 'head extra'); 105 like(http_head('/head/extra'), qr/200 OK(?!.*SEE-THIS)/s, 'head extra');
118 like(http_head('/head/short'), qr/200 OK(?!.*SEE-THIS)/s, 'head too short'); 106 like(http_head('/head/short'), qr/200 OK(?!.*SEE-THIS)/s, 'head too short');
119 107
120 like(http_get('/head/empty'), qr/SEE-THIS/, 'head no body cached'); 108 like(http_get('/head/empty'), qr/SEE-THIS/, 'head no body cached');
121 like(http_get('/head/matching'), qr/SEE-THIS/, 'head matching cached'); 109 like(http_get('/head/matching'), qr/SEE-THIS/, 'head matching cached');
122
123 TODO: {
124 local $TODO = 'not yet' unless $t->has_version('1.19.1');
125
126 like(http_get('/head/extra'), qr/SEE-THIS(?!-BUT-NOT-THIS)/s, 110 like(http_get('/head/extra'), qr/SEE-THIS(?!-BUT-NOT-THIS)/s,
127 'head extra cached'); 111 'head extra cached');
128
129 }
130
131 like(http_get('/head/short'), qr/SEE-THIS(?!.*:after)/s, 112 like(http_get('/head/short'), qr/SEE-THIS(?!.*:after)/s,
132 'head too short cached'); 113 'head too short cached');
133 114
134
135 # "zero size buf" alerts (ticket #2117) 115 # "zero size buf" alerts (ticket #2117)
136 116
137 TODO: {
138 local $TODO = 'not yet' unless $t->has_version('1.19.1');
139
140 like(http_get('/zero'), qr/200 OK(?!.*NOT-THIS)/s, 'zero size'); 117 like(http_get('/zero'), qr/200 OK(?!.*NOT-THIS)/s, 'zero size');
141
142 }
143
144 TODO: {
145 local $TODO = 'not yet' unless $t->has_version('1.19.7');
146
147 like(http_get('/unbuf/zero'), qr/200 OK(?!.*NOT-THIS)/s, 118 like(http_get('/unbuf/zero'), qr/200 OK(?!.*NOT-THIS)/s,
148 'unbuffered zero size'); 119 'unbuffered zero size');
149
150 }
151
152 $t->todo_alerts() if $t->has_version('1.19.1') and !$t->has_version('1.19.7');
153 120
154 ############################################################################### 121 ###############################################################################
155 122
156 sub http_daemon { 123 sub http_daemon {
157 my $server = IO::Socket::INET->new( 124 my $server = IO::Socket::INET->new(