Mercurial > hg > nginx-tests
changeset 1111:6c2538ad642d
Tests: auth external in mail is explicitly enabled since 1.11.9.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 12 Jan 2017 19:23:14 +0300 |
parents | b9b115a2a28d |
children | 79f93c764353 |
files | mail_imap.t mail_pop3.t mail_smtp.t |
diffstat | 3 files changed, 15 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/mail_imap.t +++ b/mail_imap.t @@ -26,7 +26,7 @@ select STDOUT; $| = 1; local $SIG{PIPE} = 'IGNORE'; -my $t = Test::Nginx->new()->has(qw/mail imap http rewrite/)->plan(14) +my $t = Test::Nginx->new()->has(qw/mail imap http rewrite/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -43,7 +43,7 @@ mail { server { listen 127.0.0.1:8143; protocol imap; - imap_auth plain cram-md5; + imap_auth plain cram-md5 external; } } @@ -92,7 +92,9 @@ http { EOF $t->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon); -$t->run()->waitforsocket('127.0.0.1:' . port(8144)); +$t->try_run('no auth external')->plan(14); + +$t->waitforsocket('127.0.0.1:' . port(8144)); ############################################################################### @@ -148,9 +150,6 @@ my $s = Test::Nginx::IMAP->new(); $s->send(encode_base64('test@example.com ' . ('0' x 32), '')); $s->ok('auth cram-md5'); -TODO: { -local $TODO = 'not yet' unless $t->has_version('1.11.6'); - # auth external $s = Test::Nginx::IMAP->new(); @@ -170,6 +169,4 @@ local $TODO = 'not yet' unless $t->has_v $s->send('1 AUTHENTICATE EXTERNAL ' . encode_base64('test@example.com', '')); $s->ok('auth external with username'); -} - ###############################################################################
--- a/mail_pop3.t +++ b/mail_pop3.t @@ -26,7 +26,7 @@ select STDOUT; $| = 1; local $SIG{PIPE} = 'IGNORE'; -my $t = Test::Nginx->new()->has(qw/mail pop3 http rewrite/)->plan(18) +my $t = Test::Nginx->new()->has(qw/mail pop3 http rewrite/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -43,7 +43,7 @@ mail { server { listen 127.0.0.1:8110; protocol pop3; - pop3_auth plain apop cram-md5; + pop3_auth plain apop cram-md5 external; } } @@ -92,7 +92,9 @@ http { EOF $t->run_daemon(\&Test::Nginx::POP3::pop3_test_daemon); -$t->run()->waitforsocket('127.0.0.1:' . port(8111)); +$t->try_run('no auth external')->plan(18); + +$t->waitforsocket('127.0.0.1:' . port(8111)); ############################################################################### @@ -165,9 +167,6 @@ my $s = Test::Nginx::POP3->new(); $s->send(encode_base64('test@example.com ' . ('0' x 32), '')); $s->ok('auth cram-md5'); -TODO: { -local $TODO = 'not yet' unless $t->has_version('1.11.6'); - # auth external $s = Test::Nginx::POP3->new(); @@ -187,6 +186,4 @@ local $TODO = 'not yet' unless $t->has_v $s->send('AUTH EXTERNAL ' . encode_base64('test@example.com', '')); $s->ok('auth external with username'); -} - ###############################################################################
--- a/mail_smtp.t +++ b/mail_smtp.t @@ -27,7 +27,7 @@ select STDOUT; $| = 1; local $SIG{PIPE} = 'IGNORE'; -my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/)->plan(30) +my $t = Test::Nginx->new()->has(qw/mail smtp http rewrite/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -45,7 +45,7 @@ mail { server { listen 127.0.0.1:8025; protocol smtp; - smtp_auth login plain none cram-md5; + smtp_auth login plain none cram-md5 external; } } @@ -90,7 +90,9 @@ http { EOF $t->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon); -$t->run()->waitforsocket('127.0.0.1:' . port(8026)); +$t->try_run('no auth external')->plan(30); + +$t->waitforsocket('127.0.0.1:' . port(8026)); ############################################################################### @@ -161,9 +163,6 @@ my $s = Test::Nginx::SMTP->new(); $s->send(encode_base64('test@example.com ' . ('0' x 32), '')); $s->authok('auth cram-md5'); -TODO: { -local $TODO = 'not yet' unless $t->has_version('1.11.6'); - # Try auth external $s = Test::Nginx::SMTP->new(); @@ -186,8 +185,6 @@ local $TODO = 'not yet' unless $t->has_v $s->send('AUTH EXTERNAL ' . encode_base64('test@example.com', '')); $s->ok('auth external with username'); -} - # Try auth plain with pipelining $s = Test::Nginx::SMTP->new();