diff syslog.t @ 974:882267679006

Tests: simplified parallel modifications in tests. Mail tests were simplified in c227348453db.
author Andrey Zelenkov <zelenkov@nginx.com>
date Tue, 12 Jul 2016 17:39:03 +0300
parents e9064d691790
children 196d33c2bb45
line wrap: on
line diff
--- a/syslog.t
+++ b/syslog.t
@@ -30,7 +30,7 @@ my $t = Test::Nginx->new()->has(qw/http 
 
 %%TEST_GLOBALS%%
 
-error_log syslog:server=127.0.0.1:%%PORT_1_UDP%% info;
+error_log syslog:server=127.0.0.1:%%PORT_8081_UDP%% info;
 error_log %%TESTDIR%%/f_glob.log info;
 
 daemon off;
@@ -46,102 +46,102 @@ http {
     log_format empty "";
     log_format logf "$uri:$status";
 
-    error_log syslog:server=127.0.0.1:%%PORT_2_UDP%% info;
+    error_log syslog:server=127.0.0.1:%%PORT_8082_UDP%% info;
     error_log %%TESTDIR%%/f_http.log info;
 
     server {
-        listen       127.0.0.1:%%PORT_0%%;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location /e {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /a {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /ef {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,facility=user;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,facility=user;
         }
         location /es {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,severity=alert;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,severity=alert;
         }
         location /et {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,tag=SEETHIS;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,tag=SEETHIS;
         }
         location /af {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,facility=user;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,facility=user;
         }
         location /as {
             # put severity inside to catch possible parsing programming errors
-            access_log syslog:severity=alert,server=127.0.0.1:%%PORT_4_UDP%%;
+            access_log syslog:severity=alert,server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /at {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,tag=SEETHIS;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,tag=SEETHIS;
         }
         location /e2 {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /a2 {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /a_logf {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%% logf;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% logf;
         }
         location /if {
-            access_log syslog:server=127.0.0.1:%%PORT_3_UDP%% logf
+            access_log syslog:server=127.0.0.1:%%PORT_8083_UDP%% logf
                 if=$arg_logme;
         }
 
         location /nohostname {
-            access_log syslog:server=127.0.0.1:%%PORT_4_UDP%%,nohostname;
+            access_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%,nohostname;
         }
 
         location /debug {
             limit_req zone=one;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% debug;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% debug;
         }
         location /info {
             limit_req zone=one;
             limit_req_log_level info;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% info;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% info;
         }
         location /notice {
             limit_req zone=one;
             limit_req_log_level notice;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% notice;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% notice;
         }
         location /warn {
             limit_req zone=one;
             limit_req_log_level warn;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% warn;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% warn;
         }
         location /error {
             limit_req zone=one;
             limit_req_log_level error;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /low {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% warn;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% warn;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /dup {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
         location /high {
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%% emerg;
-            error_log syslog:server=127.0.0.1:%%PORT_4_UDP%%;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%% emerg;
+            error_log syslog:server=127.0.0.1:%%PORT_8084_UDP%%;
         }
     }
 }
 
 EOF
 
-$t->run_daemon(\&syslog_daemon, port(1), $t, 's_glob.log');
-$t->run_daemon(\&syslog_daemon, port(2), $t, 's_http.log');
-$t->run_daemon(\&syslog_daemon, port(3), $t, 's_if.log');
+$t->run_daemon(\&syslog_daemon, port(8081), $t, 's_glob.log');
+$t->run_daemon(\&syslog_daemon, port(8082), $t, 's_http.log');
+$t->run_daemon(\&syslog_daemon, port(8083), $t, 's_if.log');
 
 $t->waitforfile($t->testdir . '/s_glob.log');
 $t->waitforfile($t->testdir . '/s_http.log');
@@ -251,7 +251,7 @@ sub get_syslog {
 		alarm(1);
 		$s = IO::Socket::INET->new(
 			Proto => 'udp',
-			LocalAddr => '127.0.0.1:' . port(4)
+			LocalAddr => '127.0.0.1:' . port(8084)
 		);
 		alarm(0);
 	};