Mercurial > hg > nginx-tests
diff mail_smtp.t @ 952:e9064d691790
Tests: converted tests to run in parallel.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Tue, 21 Jun 2016 16:39:13 +0300 |
parents | 481d705b8610 |
children | c227348453db |
line wrap: on
line diff
--- a/mail_smtp.t Tue Jun 21 16:37:58 2016 +0300 +++ b/mail_smtp.t Tue Jun 21 16:39:13 2016 +0300 @@ -29,7 +29,7 @@ my $t = Test::Nginx->new() ->has(qw/mail smtp http rewrite/)->plan(25) - ->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon) + ->run_daemon(\&Test::Nginx::SMTP::smtp_test_daemon, port(2)) ->write_file_expand('nginx.conf', <<'EOF')->run(); %%TEST_GLOBALS%% @@ -41,11 +41,11 @@ mail { proxy_pass_error_message on; - auth_http http://127.0.0.1:8080/mail/auth; + auth_http http://127.0.0.1:%%PORT_0%%/mail/auth; xclient off; server { - listen 127.0.0.1:8025; + listen 127.0.0.1:%%PORT_1%%; protocol smtp; smtp_auth login plain none; } @@ -55,7 +55,7 @@ %%TEST_GLOBALS_HTTP%% server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; location = /mail/auth { @@ -72,7 +72,7 @@ add_header Auth-Status $reply; add_header Auth-Server 127.0.0.1; - add_header Auth-Port 8026; + add_header Auth-Port %%PORT_2%%; add_header Auth-Wait 1; return 204; } @@ -83,7 +83,7 @@ ############################################################################### -my $s = Test::Nginx::SMTP->new(); +my $s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->check(qr/^220 /, "greeting"); $s->send('EHLO example.com'); @@ -111,7 +111,7 @@ # Try auth login in simple form -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -128,7 +128,7 @@ # [MS-XLOGIN]: SMTP Protocol AUTH LOGIN Extension Specification # http://download.microsoft.com/download/5/D/D/5DD33FDF-91F5-496D-9884-0A0B0EE698BB/%5BMS-XLOGIN%5D.pdf -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -140,7 +140,7 @@ # Try auth plain with pipelining -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -164,7 +164,7 @@ # Try auth none -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -180,7 +180,7 @@ # Auth none with pipelining -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -195,7 +195,7 @@ # Connection must stay even if error returned to rcpt to command -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('EHLO example.com'); $s->read(); @@ -211,7 +211,7 @@ # Make sure command split into many packets processed correctly -$s = Test::Nginx::SMTP->new(); +$s = Test::Nginx::SMTP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->print('HEL');