Mercurial > hg > nginx-tests
changeset 1683:994d1b58cbe8
Tests: POP3 pipelining tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 19 May 2021 04:33:07 +0300 |
parents | 57ff83315818 |
children | e7f0b4ca0a1a |
files | mail_pop3.t |
diffstat | 1 files changed, 47 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mail_pop3.t Wed May 19 04:33:05 2021 +0300 +++ b/mail_pop3.t Wed May 19 04:33:07 2021 +0300 @@ -12,6 +12,7 @@ use Test::More; use MIME::Base64; +use Socket qw/ CRLF /; BEGIN { use FindBin; chdir($FindBin::Bin); } @@ -89,7 +90,7 @@ EOF $t->run_daemon(\&Test::Nginx::POP3::pop3_test_daemon); -$t->run()->plan(20); +$t->run()->plan(28); $t->waitforsocket('127.0.0.1:' . port(8111)); @@ -193,6 +194,51 @@ $s->send('AUTH EXTERNAL ' . encode_base64('test@example.com', '')); $s->ok('auth external with username'); +# pipelining + +$s = Test::Nginx::POP3->new(); +$s->read(); + +$s->send('INVALID COMMAND WITH ARGUMENTS' . CRLF + . 'NOOP'); +$s->check(qr/^-ERR/, 'pipelined invalid command'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.21.0'); + +$s->ok('pipelined noop after invalid command'); + +} + +$s->send('USER test@example.com' . CRLF + . 'PASS secret' . CRLF + . 'QUIT'); +$s->ok('pipelined user'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.21.0'); + +$s->ok('pipelined pass'); +$s->ok('pipelined quit'); + +} + +$s = Test::Nginx::POP3->new(); +$s->read(); + +$s->send('AUTH LOGIN' . CRLF + . encode_base64('test@example.com', '') . CRLF + . encode_base64('secret', '')); +$s->check(qr/\+ VXNlcm5hbWU6/, 'pipelined auth username challenge'); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.21.0'); + +$s->check(qr/\+ UGFzc3dvcmQ6/, 'pipelined auth password challenge'); +$s->ok('pipelined auth'); + +} + ############################################################################### sub get_auth_caps {