comparison scgi_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
79 $t->run_daemon(\&scgi_daemon); 79 $t->run_daemon(\&scgi_daemon);
80 $t->run()->waitforsocket('127.0.0.1:' . port(8081)); 80 $t->run()->waitforsocket('127.0.0.1:' . port(8081));
81 81
82 ############################################################################### 82 ###############################################################################
83 83
84 TODO: {
85 local $TODO = 'not yet' unless $t->has_version('1.19.1');
86
87 like(http_get('/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 'response with extra data'); 84 like(http_get('/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 'response with extra data');
88 like(http_get('/short'), qr/SEE-THIS(?!.*:after)/s, 'too short response'); 85 like(http_get('/short'), qr/SEE-THIS(?!.*:after)/s, 'too short response');
89 like(http_get('/empty'), qr/200 OK(?!.*:after)/s, 'empty too short response'); 86 like(http_get('/empty'), qr/200 OK(?!.*:after)/s, 'empty too short response');
90
91 }
92 87
93 like(http_head('/'), qr/200 OK(?!.*SEE-THIS)/s, 'no data in HEAD'); 88 like(http_head('/'), qr/200 OK(?!.*SEE-THIS)/s, 'no data in HEAD');
94 like(http_head('/short'), qr/200 OK(?!.*SEE-THIS)/s, 'too short to HEAD'); 89 like(http_head('/short'), qr/200 OK(?!.*SEE-THIS)/s, 'too short to HEAD');
95 like(http_head('/empty'), qr/200 OK/, 'empty response to HEAD'); 90 like(http_head('/empty'), qr/200 OK/, 'empty response to HEAD');
96 91
97 # unbuffered responses 92 # unbuffered responses
98 93
99 TODO: {
100 local $TODO = 'not yet' unless $t->has_version('1.19.1');
101
102 like(http_get('/unbuf/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/, 94 like(http_get('/unbuf/'), qr/SEE-THIS(?!-BUT-NOT-THIS)/,
103 'unbuffered with extra data'); 95 'unbuffered with extra data');
104 like(http_get('/unbuf/short'), qr/SEE-THIS(?!.*:after)/s, 96 like(http_get('/unbuf/short'), qr/SEE-THIS(?!.*:after)/s,
105 'unbuffered too short response'); 97 'unbuffered too short response');
106 like(http_get('/unbuf/empty'), qr/200 OK(?!.*:after)/s, 98 like(http_get('/unbuf/empty'), qr/200 OK(?!.*:after)/s,
107 'unbuffered empty too short response'); 99 'unbuffered empty too short response');
108
109 }
110 100
111 like(http_head('/unbuf/'), qr/200 OK(?!.*SEE-THIS)/s, 101 like(http_head('/unbuf/'), qr/200 OK(?!.*SEE-THIS)/s,
112 'unbuffered no data in HEAD'); 102 'unbuffered no data in HEAD');
113 like(http_head('/unbuf/short'), qr/200 OK(?!.*SEE-THIS)/s, 103 like(http_head('/unbuf/short'), qr/200 OK(?!.*SEE-THIS)/s,
114 'unbuffered too short response to HEAD'); 104 'unbuffered too short response to HEAD');
122 like(http_head('/head/extra'), qr/200 OK(?!.*SEE-THIS)/s, 'head extra'); 112 like(http_head('/head/extra'), qr/200 OK(?!.*SEE-THIS)/s, 'head extra');
123 like(http_head('/head/short'), qr/200 OK(?!.*SEE-THIS)/s, 'head too short'); 113 like(http_head('/head/short'), qr/200 OK(?!.*SEE-THIS)/s, 'head too short');
124 114
125 like(http_get('/head/empty'), qr/SEE-THIS/, 'head no body cached'); 115 like(http_get('/head/empty'), qr/SEE-THIS/, 'head no body cached');
126 like(http_get('/head/matching'), qr/SEE-THIS/, 'head matching cached'); 116 like(http_get('/head/matching'), qr/SEE-THIS/, 'head matching cached');
127
128 TODO: {
129 local $TODO = 'not yet' unless $t->has_version('1.19.1');
130
131 like(http_get('/head/extra'), qr/SEE-THIS(?!-BUT-NOT-THIS)/s, 117 like(http_get('/head/extra'), qr/SEE-THIS(?!-BUT-NOT-THIS)/s,
132 'head extra cached'); 118 'head extra cached');
133 like(http_get('/head/short'), qr/SEE-THIS(?!.*:after)/s, 119 like(http_get('/head/short'), qr/SEE-THIS(?!.*:after)/s,
134 'head too short cached'); 120 'head too short cached');
135 121
136 }
137
138 # "zero size buf" alerts (ticket #2117) 122 # "zero size buf" alerts (ticket #2117)
139 123
140 TODO: {
141 local $TODO = 'not yet' unless $t->has_version('1.19.1');
142
143 like(http_get('/zero'), qr/200 OK(?!.*NOT-THIS)/s, 'zero size'); 124 like(http_get('/zero'), qr/200 OK(?!.*NOT-THIS)/s, 'zero size');
144
145 }
146
147 TODO: {
148 local $TODO = 'not yet' unless $t->has_version('1.19.7');
149
150 like(http_get('/unbuf/zero'), qr/200 OK(?!.*NOT-THIS)/s, 125 like(http_get('/unbuf/zero'), qr/200 OK(?!.*NOT-THIS)/s,
151 'unbuffered zero size'); 126 'unbuffered zero size');
152
153 }
154
155 $t->todo_alerts() if $t->has_version('1.19.1') and !$t->has_version('1.19.7');
156 127
157 ############################################################################### 128 ###############################################################################
158 129
159 sub scgi_daemon { 130 sub scgi_daemon {
160 my $server = IO::Socket::INET->new( 131 my $server = IO::Socket::INET->new(