aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-07 13:52:03 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-07 13:52:03 -0400
commitc46e99c43c4ee032127f2229070e5c21c64d19be (patch)
treed1b85f57a1d42deb25574a5b588fe36c8fd20376 /src/test/test_util.c
parentecc5feff386890ad34378c70a20cbbdd0d338225 (diff)
downloadtor-c46e99c43c4ee032127f2229070e5c21c64d19be.tar.gz
tor-c46e99c43c4ee032127f2229070e5c21c64d19be.zip
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.
Diffstat (limited to 'src/test/test_util.c')
-rw-r--r--src/test/test_util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 2faadd4e19..41ecbfd388 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]));