changeset 45:d68b85def521

Tests: use 127.0.0.1 instead of localhost. Name 'localhost' is ambiguous if ipv6 present on system.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 02 Nov 2008 15:01:41 +0300
parents daa295331acd
children 239a346b4913
files fastcgi.t lib/Test/Nginx.pm lib/Test/Nginx/SMTP.pm memcached.t proxy-noclose.t proxy.t range-flv.t range.t smtp-greeting-delay.t smtp.t ssi-include-big.t
diffstat 11 files changed, 19 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/fastcgi.t
+++ b/fastcgi.t
@@ -42,7 +42,7 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
@@ -75,7 +75,7 @@ sub fastcgi_daemon {
 	while( $request->Accept() >= 0 ) {
 		$count++;
 		print <<EOF;
-Location: http://localhost:8080/redirect
+Location: http://127.0.0.1:8080/redirect
 Content-Type: text/html
 
 SEE-THIS
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -212,7 +212,7 @@ sub http($) {
 		alarm(2);
 		my $s = IO::Socket::INET->new(
 			Proto => 'tcp',
-			PeerHost => 'localhost:8080'
+			PeerAddr => '127.0.0.1:8080'
 		);
 		log_out($request);
 		$s->print($request);
--- a/lib/Test/Nginx/SMTP.pm
+++ b/lib/Test/Nginx/SMTP.pm
@@ -22,8 +22,7 @@ sub new {
 
 	my $self = return $class->SUPER::new(
 		Proto => "tcp",
-		PeerAddr => "localhost",
-		PeerPort => 8025,
+		PeerAddr => "127.0.0.1:8025",
 		@_
 	)
 		or die "Can't connect to nginx: $!\n";
--- a/memcached.t
+++ b/memcached.t
@@ -42,7 +42,7 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
--- a/proxy-noclose.t
+++ b/proxy-noclose.t
@@ -52,16 +52,16 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
         }
 
         location /uselen {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
 
             # test will wait only 2s for reply, we it will fail if
             # Content-Length not used as a hint
--- a/proxy.t
+++ b/proxy.t
@@ -41,11 +41,11 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
         }
     }
--- a/range-flv.t
+++ b/range-flv.t
@@ -41,7 +41,7 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
         location / {
             flv;
--- a/range.t
+++ b/range.t
@@ -45,7 +45,7 @@ http {
     }
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location /t2.html {
--- a/smtp-greeting-delay.t
+++ b/smtp-greeting-delay.t
@@ -32,11 +32,11 @@ events {
 
 mail {
     proxy_pass_error_message  on;
-    auth_http  http://localhost:8080/mail/auth;
+    auth_http  http://127.0.0.1:8080/mail/auth;
     xclient    off;
 
     server {
-        listen     localhost:8025;
+        listen     127.0.0.1:8025;
         protocol   smtp;
         smtp_greeting_delay  100ms;
     }
--- a/smtp.t
+++ b/smtp.t
@@ -39,11 +39,11 @@ events {
 
 mail {
     proxy_pass_error_message  on;
-    auth_http  http://localhost:8080/mail/auth;
+    auth_http  http://127.0.0.1:8080/mail/auth;
     xclient    off;
 
     server {
-        listen     localhost:8025;
+        listen     127.0.0.1:8025;
         protocol   smtp;
         smtp_auth  login plain none;
     }
@@ -57,7 +57,7 @@ http {
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location = /mail/auth {
--- a/ssi-include-big.t
+++ b/ssi-include-big.t
@@ -45,11 +45,11 @@ http {
     gzip on;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location /proxy/ {
-            proxy_pass http://localhost:8080/local/;
+            proxy_pass http://127.0.0.1:8080/local/;
         }
         location = /local/blah {
             return 204;