You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 31218db
Browse filesBrowse the repository at this point in the historyBrowse files
test(mesh): assert host_network nodes advertise only addresses of their own VM
assert_direct_paths checked the path tailscale ping settled on, which
depends on latency measured during the run. It now also checks that every
endpoint each node advertises for itself is an address of its own VM's
interfaces, so an endpoint learnt over STUN, which can carry a path through
the runner's NAT, fails the scenario on every run that has one rather than
on the runs where it happens to win. The bridge addresses its Docker and k3s
create are interface addresses of the VM too, so they are allowed.
# With host networking, every node's Tailscale client must reach every other node directly at that node's daemon's own address (its stand-in LAN address), not through a relay, and the node container must publish no port.
568
568
assert_direct_paths() {
569
-
local index other status deadline
569
+
local index other status deadline own outside
570
570
forindexin$(seq 1 "$node_count");do
571
571
[ "$(docker_on "$index" inspect --format '{{.HostConfig.NetworkMode}}'"$(container "$index")")"= host ] || fail "$(container "$index") is not on the host network"
572
572
[ -z"$(docker_on "$index" port "$(container "$index")")" ] || fail "$(container "$index") publishes ports: $(docker_on "$index" port "$(container "$index")")"
# Every endpoint each node advertises for itself is an address of its own VM's interfaces (the test network address, and the bridges its Docker and k3s create): none is an address learnt over STUN, which belongs to the runner's NAT and would let its peers pick a path through it instead (see start_vms). tailscale status lists a node's own endpoints under Self.Addrs, and none for its peers (UpdateStatus in wgengine/magicsock/magicsock.go of the pinned Tailscale fills Self only). The node container is on its VM's host network, so the VM's interfaces are the node's.
585
+
forindexin$(seq 1 "$node_count");do
586
+
own=$(docker exec"$(vm "$index")" ip -o addr show | awk '{ split($4, parts, "/"); print parts[1] }')
587
+
status=$(docker_on "$index"exec"$(container "$index")" tailscale status --json </dev/null)
0 commit comments