summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-01-07 13:25:42 -0500
committerDan Winship <danw@gnome.org>2014-01-07 13:25:42 -0500
commit4684b8c77f65db28a39bbd2c88d861d41931498c (patch)
tree1e172db374f47300db09e017248faa88a952ed1a
parentc6ca559e4e29bf00b6f61387b2e24fe53e463312 (diff)
downloadlibsoup-4684b8c77f65db28a39bbd2c88d861d41931498c.tar.gz
tests: ignore proxy settings
Some of the tests depend in various ways on the fact that they are not going through a proxy, so make sure they really aren't (by forcing the use of the dummy GProxyResolver). Likewise, pass "--noproxy *" to curl in the tests that use it, to make sure it doesn't pick up $http_proxy, etc. Pointed out by Dirkjan Ochtman on IRC.
-rw-r--r--tests/forms-test.c4
-rw-r--r--tests/server-auth-test.c2
-rw-r--r--tests/test-utils.c1
3 files changed, 7 insertions, 0 deletions
diff --git a/tests/forms-test.c b/tests/forms-test.c
index 3b6e5c16..cf8963c3 100644
--- a/tests/forms-test.c
+++ b/tests/forms-test.c
@@ -51,6 +51,8 @@ do_hello_test (int n, gboolean extra, const char *uri)
args = g_ptr_array_new ();
g_ptr_array_add (args, "curl");
+ g_ptr_array_add (args, "--noproxy");
+ g_ptr_array_add (args, "*");
g_ptr_array_add (args, "-G");
if (tests[n].title) {
title_arg = soup_form_encode ("title", tests[n].title, NULL);
@@ -114,6 +116,8 @@ do_md5_test_curl (const char *uri, const char *file, const char *md5)
args = g_ptr_array_new ();
g_ptr_array_add (args, "curl");
+ g_ptr_array_add (args, "--noproxy");
+ g_ptr_array_add (args, "*");
g_ptr_array_add (args, "-L");
g_ptr_array_add (args, "-F");
file_arg = g_strdup_printf ("file=@%s", file);
diff --git a/tests/server-auth-test.c b/tests/server-auth-test.c
index 33cff45a..78cd0686 100644
--- a/tests/server-auth-test.c
+++ b/tests/server-auth-test.c
@@ -48,6 +48,8 @@ do_test (int n, SoupURI *base_uri, const char *path,
args = g_ptr_array_new ();
g_ptr_array_add (args, "curl");
+ g_ptr_array_add (args, "--noproxy");
+ g_ptr_array_add (args, "*");
g_ptr_array_add (args, "-f");
g_ptr_array_add (args, "-s");
if (offer_basic || offer_digest) {
diff --git a/tests/test-utils.c b/tests/test-utils.c
index f4632a9b..36b0ee5d 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -83,6 +83,7 @@ test_init (int argc, char **argv, GOptionEntry *entries)
setlocale (LC_ALL, "");
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
+ g_setenv ("GIO_USE_PROXY_RESOLVER", "dummy", TRUE);
name = strrchr (argv[0], '/');
if (!name++)