Mercurial > hg > nginx-tests
diff mail_imap.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 | b70df6924290 |
children | c227348453db |
line wrap: on
line diff
--- a/mail_imap.t +++ b/mail_imap.t @@ -28,7 +28,7 @@ local $SIG{PIPE} = 'IGNORE'; my $t = Test::Nginx->new() ->has(qw/mail imap http rewrite/)->plan(9) - ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon) + ->run_daemon(\&Test::Nginx::IMAP::imap_test_daemon, port(2)) ->write_file_expand('nginx.conf', <<'EOF')->run(); %%TEST_GLOBALS%% @@ -40,10 +40,10 @@ events { 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; server { - listen 127.0.0.1:8143; + listen 127.0.0.1:%%PORT_1%%; protocol imap; } } @@ -52,7 +52,7 @@ http { %%TEST_GLOBALS_HTTP%% server { - listen 127.0.0.1:8080; + listen 127.0.0.1:%%PORT_0%%; server_name localhost; location = /mail/auth { @@ -69,7 +69,7 @@ http { add_header Auth-Status $reply; add_header Auth-Server 127.0.0.1; - add_header Auth-Port 8144; + add_header Auth-Port %%PORT_2%%; add_header Auth-Wait 1; return 204; } @@ -80,7 +80,7 @@ EOF ############################################################################### -my $s = Test::Nginx::IMAP->new(); +my $s = Test::Nginx::IMAP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->ok('greeting'); # bad auth @@ -98,7 +98,7 @@ my $s = Test::Nginx::IMAP->new(); # auth login simple -$s = Test::Nginx::IMAP->new(); +$s = Test::Nginx::IMAP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('1 AUTHENTICATE LOGIN'); @@ -112,7 +112,7 @@ my $s = Test::Nginx::IMAP->new(); # auth login with username -$s = Test::Nginx::IMAP->new(); +$s = Test::Nginx::IMAP->new(PeerAddr => '127.0.0.1:' . port(1)); $s->read(); $s->send('1 AUTHENTICATE LOGIN ' . encode_base64('test@example.com', ''));