libsoup r1257 - in trunk: . tests



Author: danw
Date: Fri Mar 27 19:47:03 2009
New Revision: 1257
URL: http://svn.gnome.org/viewvc/libsoup?rev=1257&view=rev

Log:
	Bug 576583 - Tests fail if "localhost" resolves to ::1

	* tests/*.c: Use "127.0.0.1" in URIs rather than "localhost",
	since the default SoupServer config only listen on IPv4 (qv bug
	522519), and tests/httpd.conf.in only configures apache to listen
	on IPv4, and we don't handle multiple IP addresses (qv bug 526321)
	but the machine might be configured to return "::1" rather than
	"127.0.0.1" first for "localhost". Patch from Andreas Rottmann.


Modified:
   trunk/ChangeLog
   trunk/tests/auth-test.c
   trunk/tests/chunk-test.c
   trunk/tests/context-test.c
   trunk/tests/continue-test.c
   trunk/tests/forms-test.c
   trunk/tests/misc-test.c
   trunk/tests/ntlm-test.c
   trunk/tests/pull-api.c
   trunk/tests/range-test.c
   trunk/tests/redirect-test.c
   trunk/tests/server-auth-test.c
   trunk/tests/streaming-test.c
   trunk/tests/xmlrpc-server-test.c
   trunk/tests/xmlrpc-test.c

Modified: trunk/tests/auth-test.c
==============================================================================
--- trunk/tests/auth-test.c	(original)
+++ trunk/tests/auth-test.c	Fri Mar 27 19:47:03 2009
@@ -684,7 +684,7 @@
 	soup_server_add_handler (server, NULL,
 				 server_callback, NULL, NULL);
 
-	uri = soup_uri_new ("http://localhost/";);
+	uri = soup_uri_new ("http://127.0.0.1/";);
 	soup_uri_set_port (uri, soup_server_get_port (server));
 
 	basic_auth_domain = soup_auth_domain_basic_new (
@@ -765,7 +765,7 @@
 	test_init (argc, argv, NULL);
 	apache_init ();
 
-	base_uri = "http://localhost:47524/";;
+	base_uri = "http://127.0.0.1:47524/";;
 
 	session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);
 	g_signal_connect (session, "authenticate",

Modified: trunk/tests/chunk-test.c
==============================================================================
--- trunk/tests/chunk-test.c	(original)
+++ trunk/tests/chunk-test.c	Fri Mar 27 19:47:03 2009
@@ -363,7 +363,7 @@
 
 	loop = g_main_loop_new (NULL, TRUE);
 
-	base_uri = soup_uri_new ("http://localhost";);
+	base_uri = soup_uri_new ("http://127.0.0.1";);
 	soup_uri_set_port (base_uri, port);
 	do_chunk_tests (base_uri);
 	soup_uri_free (base_uri);

Modified: trunk/tests/context-test.c
==============================================================================
--- trunk/tests/context-test.c	(original)
+++ trunk/tests/context-test.c	Fri Mar 27 19:47:03 2009
@@ -263,7 +263,7 @@
 
 	server = soup_test_server_new (TRUE);
 	soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
-	base_uri = g_strdup_printf ("http://localhost:%u/";,
+	base_uri = g_strdup_printf ("http://127.0.0.1:%u/";,
 				    soup_server_get_port (server));
 
 	do_test1 ();

Modified: trunk/tests/continue-test.c
==============================================================================
--- trunk/tests/continue-test.c	(original)
+++ trunk/tests/continue-test.c	Fri Mar 27 19:47:03 2009
@@ -76,7 +76,7 @@
 		      expect_continue ? "" : "no ",
 		      auth ? "with" : "without");
 
-	uri = g_strdup_printf ("http://%slocalhost:%d/%s";,
+	uri = g_strdup_printf ("http://%s127.0.0.1:%d/%s";,
 			       auth ? "user:pass@" : "",
 			       port, path);
 	msg = soup_message_new ("POST", uri);

Modified: trunk/tests/forms-test.c
==============================================================================
--- trunk/tests/forms-test.c	(original)
+++ trunk/tests/forms-test.c	Fri Mar 27 19:47:03 2009
@@ -412,11 +412,11 @@
 	loop = g_main_loop_new (NULL, TRUE);
 
 	if (run_tests) {
-		uri_str = g_strdup_printf ("http://localhost:%u/hello";, port);
+		uri_str = g_strdup_printf ("http://127.0.0.1:%u/hello";, port);
 		do_hello_tests (uri_str);
 		g_free (uri_str);
 
-		uri_str = g_strdup_printf ("http://localhost:%u/md5";, port);
+		uri_str = g_strdup_printf ("http://127.0.0.1:%u/md5";, port);
 		do_md5_tests (uri_str);
 		g_free (uri_str);
 	} else {

Modified: trunk/tests/misc-test.c
==============================================================================
--- trunk/tests/misc-test.c	(original)
+++ trunk/tests/misc-test.c	Fri Mar 27 19:47:03 2009
@@ -156,7 +156,7 @@
 
 	/* Get a guaranteed-bad URI */
 	bad_server = soup_server_new (NULL, NULL);
-	bad_uri = g_strdup_printf ("http://localhost:%u/";,
+	bad_uri = g_strdup_printf ("http://127.0.0.1:%u/";,
 				   soup_server_get_port (bad_server));
 	g_object_unref (bad_server);
 
@@ -293,7 +293,7 @@
 
 	server = soup_test_server_new (TRUE);
 	soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
-	base_uri = soup_uri_new ("http://localhost/";);
+	base_uri = soup_uri_new ("http://127.0.0.1/";);
 	soup_uri_set_port (base_uri, soup_server_get_port (server));
 
 	auth_domain = soup_auth_domain_basic_new (

Modified: trunk/tests/ntlm-test.c
==============================================================================
--- trunk/tests/ntlm-test.c	(original)
+++ trunk/tests/ntlm-test.c	Fri Mar 27 19:47:03 2009
@@ -419,7 +419,7 @@
 
 	loop = g_main_loop_new (NULL, TRUE);
 
-	uri = soup_uri_new ("http://localhost/";);
+	uri = soup_uri_new ("http://127.0.0.1/";);
 	soup_uri_set_port (uri, soup_server_get_port (server));
 	do_ntlm_tests (uri);
 	soup_uri_free (uri);

Modified: trunk/tests/pull-api.c
==============================================================================
--- trunk/tests/pull-api.c	(original)
+++ trunk/tests/pull-api.c	Fri Mar 27 19:47:03 2009
@@ -494,7 +494,7 @@
 	test_init (argc, argv, NULL);
 	apache_init ();
 
-	base_uri = "http://localhost:47524/";;
+	base_uri = "http://127.0.0.1:47524/";;
 	get_correct_response (base_uri);
 
 	debug_printf (1, "\nFully async, fast requests\n");

Modified: trunk/tests/range-test.c
==============================================================================
--- trunk/tests/range-test.c	(original)
+++ trunk/tests/range-test.c	Fri Mar 27 19:47:03 2009
@@ -356,12 +356,12 @@
 	session = soup_test_session_new (SOUP_TYPE_SESSION_ASYNC, NULL);
 
 	debug_printf (1, "1. Testing against apache\n");
-	do_range_test (session, "http://localhost:47524/";, FALSE);
+	do_range_test (session, "http://127.0.0.1:47524/";, FALSE);
 
 	debug_printf (1, "\n2. Testing against SoupServer\n");
 	server = soup_test_server_new (FALSE);
 	soup_server_add_handler (server, NULL, server_handler, NULL, NULL);
-	base_uri = g_strdup_printf ("http://localhost:%u/";,
+	base_uri = g_strdup_printf ("http://127.0.0.1:%u/";,
 				    soup_server_get_port (server));
 	do_range_test (session, base_uri, TRUE);
 	g_free (base_uri);

Modified: trunk/tests/redirect-test.c
==============================================================================
--- trunk/tests/redirect-test.c	(original)
+++ trunk/tests/redirect-test.c	Fri Mar 27 19:47:03 2009
@@ -308,7 +308,7 @@
 	loop = g_main_loop_new (NULL, TRUE);
 
 	if (run_tests) {
-		base_uri = soup_uri_new ("http://localhost";);
+		base_uri = soup_uri_new ("http://127.0.0.1";);
 		soup_uri_set_port (base_uri, port);
 		do_redirect_tests (base_uri);
 		soup_uri_free (base_uri);

Modified: trunk/tests/server-auth-test.c
==============================================================================
--- trunk/tests/server-auth-test.c	(original)
+++ trunk/tests/server-auth-test.c	Fri Mar 27 19:47:03 2009
@@ -365,7 +365,7 @@
 	loop = g_main_loop_new (NULL, TRUE);
 
 	if (run_tests) {
-		uri = soup_uri_new ("http://localhost";);
+		uri = soup_uri_new ("http://127.0.0.1";);
 		soup_uri_set_port (uri, soup_server_get_port (server));
 		do_auth_tests (uri);
 		soup_uri_free (uri);

Modified: trunk/tests/streaming-test.c
==============================================================================
--- trunk/tests/streaming-test.c	(original)
+++ trunk/tests/streaming-test.c	Fri Mar 27 19:47:03 2009
@@ -175,7 +175,7 @@
 
 	loop = g_main_loop_new (NULL, TRUE);
 
-	base_uri = soup_uri_new ("http://localhost";);
+	base_uri = soup_uri_new ("http://127.0.0.1";);
 	soup_uri_set_port (base_uri, port);
 	do_tests (base_uri);
 	soup_uri_free (base_uri);

Modified: trunk/tests/xmlrpc-server-test.c
==============================================================================
--- trunk/tests/xmlrpc-server-test.c	(original)
+++ trunk/tests/xmlrpc-server-test.c	Fri Mar 27 19:47:03 2009
@@ -322,7 +322,7 @@
 	loop = g_main_loop_new (NULL, TRUE);
 
 	if (run_tests) {
-		uri = soup_uri_new ("http://localhost/xmlrpc-server.php";);
+		uri = soup_uri_new ("http://127.0.0.1/xmlrpc-server.php";);
 		soup_uri_set_port (uri, soup_server_get_port (server));
 		do_xmlrpc_tests (uri);
 		soup_uri_free (uri);

Modified: trunk/tests/xmlrpc-test.c
==============================================================================
--- trunk/tests/xmlrpc-test.c	(original)
+++ trunk/tests/xmlrpc-test.c	Fri Mar 27 19:47:03 2009
@@ -13,7 +13,7 @@
 #include "test-utils.h"
 
 static SoupSession *session;
-static const char *default_uri = "http://localhost:47524/xmlrpc-server.php";;
+static const char *default_uri = "http://127.0.0.1:47524/xmlrpc-server.php";;
 static const char *uri = NULL;
 static gboolean server_test = FALSE;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]