~ruther/guix-local

ref: f1fc45a9fd168f3b44f03112815bda83d2c6f3ed guix-local/gnu/packages/patches/glib-tests-newnet.patch -rw-r--r-- 1.1 KiB
f1fc45a9 — Eric Bavier gnu: libbonobo: Skip failing test case. 11 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Since guix-daemon runs in a separate networking name space, the only
interface available is "lo".  However its index is incremented by one
at each build, so it can end up being greater than 255, leading to an
assertion failure in 'find_ifname_and_index'.

Work around that by directly querying the index of "lo".

--- glib-2.38.0/gio/tests/network-address.c	2013-09-17 20:47:14.000000000 +0200
+++ glib-2.38.0/gio/tests/network-address.c	2013-10-16 21:52:42.000000000 +0200
@@ -117,7 +117,7 @@ test_parse_host (gconstpointer d)
 #define SCOPE_ID_TEST_PORT 99
 
 #ifdef HAVE_IF_INDEXTONAME
-static char SCOPE_ID_TEST_IFNAME[IF_NAMESIZE];
+static char SCOPE_ID_TEST_IFNAME[] = "lo";
 static int SCOPE_ID_TEST_INDEX;
 #else
 #define SCOPE_ID_TEST_IFNAME "1"
@@ -131,11 +131,7 @@ find_ifname_and_index (void)
     return;
 
 #ifdef HAVE_IF_INDEXTONAME
-  for (SCOPE_ID_TEST_INDEX = 1; SCOPE_ID_TEST_INDEX < 255; SCOPE_ID_TEST_INDEX++) {
-    if (if_indextoname (SCOPE_ID_TEST_INDEX, SCOPE_ID_TEST_IFNAME))
-      break;
-  }
-  g_assert_cmpstr (SCOPE_ID_TEST_IFNAME, !=, "");
+  SCOPE_ID_TEST_INDEX = if_nametoindex (SCOPE_ID_TEST_IFNAME);
 #endif
 }