Opened 3 months ago

Last modified 5 weeks ago

#29573 needs_information defect

Tests fail without network interface configured

Reported by: atsampson Owned by: rl1987
Priority: Low Milestone: Tor: unspecified
Component: Core Tor/Tor Version: Tor: 0.3.5.8
Severity: Normal Keywords: 041-proposed 040-backport 035-backport
Cc: rl1987 Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

I build packages on Linux as an unprivileged user inside a network namespace with no interfaces configured (to catch packages that try to use Internet resources during the build process). With tor 0.3.5.7 and earlier, this worked fine and the test suite passed completely.

With tor 0.3.5.8, three test cases fail:

address/get_if_addrs_list_internal: Feb 24 12:59:28.031 [err] connect() failed: Network is unreachable
  [get_if_addrs_list_internal FAILED]
address/get_if_addrs_list_no_internal: Feb 24 12:59:28.040 [err] connect() failed: Network is unreachable
  [get_if_addrs_list_no_internal FAILED]
address/get_if_addrs: Feb 24 12:59:28.309 [err] connect() failed: Network is unreachable
  [get_if_addrs FAILED]

Here's strace output for one of the failures:

socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC, IPPROTO_UDP) = 6                                     
connect(6, {sa_family=AF_INET, sin_port=htons(9), sin_addr=inet_addr("18.0.0.1")}, 16) = -1 ENETUNREACH (Network is unreachable)                                    

So this looks like get_interface_address6_via_udp_socket_hack failing - comments in the tests suggest that they ought to be getting an empty list rather than an error in this circumstance?

Child Tickets

Change History (5)

comment:1 Changed 3 months ago by nickm

Keywords: 041-proposed 040-backport 035-backport added
Milestone: Tor: unspecified

Could you include a short set of instructions to replicate your testing environment here, to help us check whether we've fixed it?

comment:2 Changed 3 months ago by atsampson

Sure - I can reproduce it as root with just:

./configure
make
unshare --net make test

comment:3 Changed 2 months ago by rl1987

Cc: rl1987 added

comment:4 Changed 5 weeks ago by rl1987

Owner: set to rl1987
Status: newaccepted

When I run sudo unshare --net make test, it fails with the following error:

util/socketpair_ersatz: [forking] 
  FAIL src/test/test_util.c:5402: assert(0 OP_EQ socketpair_result): 0 vs -101
  [socketpair_ersatz FAILED]

The above test cases does not fail on my Vagrant machine. Tested with current git master (ef97e6c5534c1e0266056aa063f0467d37bd8347).

comment:5 Changed 5 weeks ago by rl1987

Status: acceptedneeds_information

Do you also see address/udp_socket_trick_blackbox failures?

Note: See TracTickets for help on using tickets.