[libsoup] tests: ignore proxy settings



commit 4684b8c77f65db28a39bbd2c88d861d41931498c
Author: Dan Winship <danw gnome org>
Date:   Tue Jan 7 13:25:42 2014 -0500

    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.

 tests/forms-test.c       |    4 ++++
 tests/server-auth-test.c |    2 ++
 tests/test-utils.c       |    1 +
 3 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/tests/forms-test.c b/tests/forms-test.c
index 3b6e5c1..cf8963c 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 33cff45..78cd068 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 f4632a9..36b0ee5 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++)


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