]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Tolerate net-unreachable failures in util/socketpair_ersatz
authorNick Mathewson <nickm@torproject.org>
Fri, 7 Jun 2019 17:52:03 +0000 (13:52 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 7 Jun 2019 17:52:03 +0000 (13:52 -0400)
This can happen when we have no network stack configured. Fixes bug
30804; bugfix on 0.2.5.1-alpha.

changes/bug30804 [new file with mode: 0644]
src/test/test_util.c

diff --git a/changes/bug30804 b/changes/bug30804
new file mode 100644 (file)
index 0000000..ba4a3e8
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (testing):
+    - Teach the util/socketpair_ersatz test to work correctly when we
+      have no network stack configured. Fixes bug 30804; bugfix on
+      0.2.5.1-alpha.
index 2faadd4e19f278d4f183d6366b366796122076e7..41ecbfd3883b8c701641cf7456cea81b3b922065 100644 (file)
@@ -5399,6 +5399,11 @@ test_util_socketpair(void *arg)
     tt_skip();
   }
 #endif /* defined(__FreeBSD__) */
+  if (ersatz && socketpair_result == -ENETUNREACH) {
+    /* We can also fail with -ENETUNREACH if we have no network stack at
+     * all. */
+    tt_skip();
+  }
   tt_int_op(0, OP_EQ, socketpair_result);
 
   tt_assert(SOCKET_OK(fds[0]));