[tor-commits] [tor/master] Tolerate net-unreachable failures in util/socketpair_ersatz

asn at torproject.org asn at torproject.org
Wed Jun 12 10:02:02 UTC 2019


commit c46e99c43c4ee032127f2229070e5c21c64d19be
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jun 7 13:52:03 2019 -0400

    Tolerate net-unreachable failures in util/socketpair_ersatz
    
    This can happen when we have no network stack configured. Fixes bug
    30804; bugfix on 0.2.5.1-alpha.
---
 changes/bug30804     | 4 ++++
 src/test/test_util.c | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/changes/bug30804 b/changes/bug30804
new file mode 100644
index 000000000..ba4a3e8b8
--- /dev/null
+++ b/changes/bug30804
@@ -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.
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 2faadd4e1..41ecbfd38 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -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]));





More information about the tor-commits mailing list