netsleuth/tests
Andrew Pimenov fd72604240 add --interface flag to force outbound probing through a specific adapter
Every probe used to follow whatever the OS default route picked, with no way
to point the tool at a specific adapter for comparison (VPN vs raw) or to
confirm which one actually carries traffic on a multi-adapter machine.

New iface.py resolves an adapter name or IP to a BindTarget (pure, tested):
exact/case-insensitive/unique-substring name match, rejects APIPA-only,
link-local-only and down adapters. Wired through every httpx provider client,
the Ookla binary tier, ndt7, and the whole ping/traceroute cascade (icmplib,
mtr, unix traceroute, TCP connect, scapy) plus --watch. Windows icmp_win now
uses IcmpSendEcho2Ex (adds SourceAddress) only when a bind is forced, so the
unforced path is unchanged. Windows tracert has no IPv4 source-address option
(verified from its own usage text) so that tier is dropped when forced,
noted in the report rather than silently measuring the wrong path.

An unresolvable/down adapter aborts with every adapter listed; a resolvable
adapter with no route to the internet degrades gracefully instead of
aborting - that's a real diagnostic answer, not an error. netinfo's
observation of the OS's actual default route stays untouched, so the report
can show the forced adapter and the OS default side by side.

Verified live: forcing Tailscale (no internet route on this box) triggered
the preflight warning and degraded correctly; forcing Ethernet ran clean
end-to-end including a full speedtest+MTR cycle.

Also noted, not fixed: probes/traceroute.py's icmplib tier imports
async_traceroute, which doesn't exist in icmplib 3.0.4 - that tier has
always raised ImportError and silently fallen through. Found while
verifying the icmplib source-binding wiring live.
2026-08-09 13:36:06 +03:00
..
fixtures compare: diff identity, latency, speed and findings between two reports 2026-08-09 03:24:03 +03:00
conftest.py project scaffold: uv packaging, config.yaml, package skeleton 2026-08-08 21:12:41 +03:00
test_bgp.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_cli_formats.py add --format/--ru/--json flags to control which report artifacts get written 2026-08-09 13:00:13 +03:00
test_compare.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_config.py add --format/--ru/--json flags to control which report artifacts get written 2026-08-09 13:00:13 +03:00
test_dns_leak.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_dnsbl_decode.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_exporter.py add --interface flag to force outbound probing through a specific adapter 2026-08-09 13:36:06 +03:00
test_icmp_win_parse.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_icmp_win_trace.py add --interface flag to force outbound probing through a specific adapter 2026-08-09 13:36:06 +03:00
test_iface.py add --interface flag to force outbound probing through a specific adapter 2026-08-09 13:36:06 +03:00
test_interpret.py fix false-positive sustained-loss verdict on long runs of silent hops 2026-08-09 13:00:19 +03:00
test_ip_geo_normalize.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_models.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_netinfo.py fix default gateway detection picking wrong route with multiple adapters 2026-08-09 13:00:24 +03:00
test_orchestration.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_prober_stats.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_reputation.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_speed_math.py add --interface flag to force outbound probing through a specific adapter 2026-08-09 13:36:06 +03:00
test_stats.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_traceparse.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00
test_traceroute_cascade.py add --interface flag to force outbound probing through a specific adapter 2026-08-09 13:36:06 +03:00
test_watch.py rename package netcheck to netsleuth (name taken on pypi) 2026-08-09 11:43:00 +03:00