diff mail_pop3.t @ 970:c227348453db

Tests: simplified parallel modifications in mail tests.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 08 Jul 2016 02:21:16 +0300
parents e9064d691790
children a8b8dd6e8ae1
line wrap: on
line diff
--- a/mail_pop3.t
+++ b/mail_pop3.t
@@ -28,7 +28,7 @@ local $SIG{PIPE} = 'IGNORE';
 
 my $t = Test::Nginx->new()
 	->has(qw/mail pop3 http rewrite/)->plan(8)
-	->run_daemon(\&Test::Nginx::POP3::pop3_test_daemon, port(2))
+	->run_daemon(\&Test::Nginx::POP3::pop3_test_daemon, port(8111))
 	->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:%%PORT_0%%/mail/auth;
+    auth_http  http://127.0.0.1:8080/mail/auth;
 
     server {
-        listen     127.0.0.1:%%PORT_1%%;
+        listen     127.0.0.1:8110;
         protocol   pop3;
     }
 }
@@ -52,7 +52,7 @@ http {
     %%TEST_GLOBALS_HTTP%%
 
     server {
-        listen       127.0.0.1:%%PORT_0%%;
+        listen       127.0.0.1:8080;
         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 %%PORT_2%%;
+            add_header Auth-Port %%PORT_8111%%;
             add_header Auth-Wait 1;
             return 204;
         }
@@ -80,7 +80,7 @@ EOF
 
 ###############################################################################
 
-my $s = Test::Nginx::POP3->new(PeerAddr => '127.0.0.1:' . port(1));
+my $s = Test::Nginx::POP3->new();
 $s->ok('greeting');
 
 # auth plain
@@ -93,7 +93,7 @@ my $s = Test::Nginx::POP3->new(PeerAddr 
 
 # auth login simple
 
-$s = Test::Nginx::POP3->new(PeerAddr => '127.0.0.1:' . port(1));
+$s = Test::Nginx::POP3->new();
 $s->read();
 
 $s->send('AUTH LOGIN');
@@ -107,7 +107,7 @@ my $s = Test::Nginx::POP3->new(PeerAddr 
 
 # auth login with username
 
-$s = Test::Nginx::POP3->new(PeerAddr => '127.0.0.1:' . port(1));
+$s = Test::Nginx::POP3->new();
 $s->read();
 
 $s->send('AUTH LOGIN ' . encode_base64('test@example.com', ''));