[libsoup/wip/ci-test] Support running tests without ipv6



commit 13258b308549ec90369fbe5403470e74b6279b91
Author: Patrick Griffis <pgriffis igalia com>
Date:   Thu Nov 26 11:27:51 2020 -0600

    Support running tests without ipv6

 .gitlab-ci.yml     | 2 +-
 tests/test-utils.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8e3dfa4c..bed976a4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -47,9 +47,9 @@ fedora-asan:
   stage: build
   tags:
     - asan
-    - ipv6
   variables:
     ASAN_OPTIONS: fast_unwind_on_malloc=0
+    SOUP_TEST_NO_IPV6: 1
   script:
     - meson _build -Dauto-features=enabled -Db_sanitize=address -Dintrospection=disabled -Dvapi=disabled
     - ninja -C _build test
diff --git a/tests/test-utils.c b/tests/test-utils.c
index de6479a0..a534a0e6 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -385,8 +385,12 @@ static void
 server_listen (SoupServer *server)
 {
        GError *error = NULL;
+        SoupServerListenOptions options = 0;
 
-       soup_server_listen_local (server, 0, 0, &error);
+        if (g_getenv ("SOUP_TEST_NO_IPV6"))
+                options = SOUP_SERVER_LISTEN_IPV4_ONLY;
+
+       soup_server_listen_local (server, 0, options, &error);
        if (error) {
                g_printerr ("Unable to create server: %s\n", error->message);
                exit (1);


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