comparison mail_imap.t @ 1686:156cb84b3c23

Tests: IMAP pipelining tests.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 19 May 2021 04:33:13 +0300
parents 869b312c214e
children 2a0a6035a1af
comparison
equal deleted inserted replaced
1685:869b312c214e 1686:156cb84b3c23
91 } 91 }
92 92
93 EOF 93 EOF
94 94
95 $t->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon); 95 $t->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon);
96 $t->run()->plan(23); 96 $t->run()->plan(29);
97 97
98 $t->waitforsocket('127.0.0.1:' . port(8144)); 98 $t->waitforsocket('127.0.0.1:' . port(8144));
99 99
100 ############################################################################### 100 ###############################################################################
101 101
229 229
230 $s->ok('backslash in literal'); 230 $s->ok('backslash in literal');
231 231
232 } 232 }
233 233
234 ############################################################################### 234 # pipelining
235
236 $s = Test::Nginx::IMAP->new();
237 $s->read();
238
239 $s->send('a01 INVALID COMMAND WITH ARGUMENTS' . CRLF
240 . 'a02 NOOP');
241 $s->check(qr/^a01 BAD/, 'pipelined invalid command');
242
243 TODO: {
244 local $TODO = 'not yet' unless $t->has_version('1.21.0');
245
246 $s->ok('pipelined noop after invalid command');
247
248 }
249
250 $s->send('a03 FOOBAR {10+}' . CRLF
251 . 'test test ' . CRLF
252 . 'a04 NOOP');
253 $s->check(qr/^a03 BAD/, 'invalid with non-sync literal');
254 $s->check(qr/^(a04 |$)/, 'literal not command');
255
256 TODO: {
257 todo_skip('not yet', 2) unless $t->has_version('1.21.0');
258
259 # skipped without a fix, since with level-triggered event methods
260 # this hogs cpu till the connection is closed by the backend server,
261 # and generates a lot of debug logs
262
263 $s = Test::Nginx::IMAP->new();
264 $s->read();
265
266 $s->send('a01 LOGIN test@example.com secret' . CRLF
267 . 'a02 LOGOUT');
268 $s->ok('pipelined login');
269 $s->ok('pipelined logout');
270
271 }
272
273 ###############################################################################