Skip to content

tests(iroh): add patchbay test matrix for switching uplinks#4095

Merged
Frando merged 6 commits intomainfrom
Frando/patchbay-switch-uplink
Apr 14, 2026
Merged

tests(iroh): add patchbay test matrix for switching uplinks#4095
Frando merged 6 commits intomainfrom
Frando/patchbay-switch-uplink

Conversation

@Frando
Copy link
Copy Markdown
Member

@Frando Frando commented Apr 9, 2026

Description

Adds a patchbay test matrix for testing uplink switching across IP family transitions (v4/v6/dual-stack) for both client and server side. Each test holepunches a direct path, replugs the switching side to a different router, and verifies that a new direct path is selected and data flows over it.

The tests all pass. Initially, the server side tests failed, and this uncovered two issues which are now fixed:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/4095/docs/iroh/

Last updated: 2026-04-14T12:30:54Z

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: 05d09a9

@n0bot n0bot bot added this to iroh Apr 9, 2026
@github-project-automation github-project-automation bot moved this to 🚑 Needs Triage in iroh Apr 9, 2026
@Frando Frando force-pushed the Frando/patchbay-switch-uplink branch from 20f7ab4 to 7f19d9a Compare April 10, 2026 08:09
@Frando Frando marked this pull request as ready for review April 10, 2026 12:53
@Frando Frando force-pushed the Frando/patchbay-switch-uplink branch from 7f19d9a to 509504b Compare April 14, 2026 08:30
Copy link
Copy Markdown
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically just a nit

Comment thread iroh/tests/patchbay/switch-uplink.rs Outdated
Comment on lines +31 to +37
enum SwitchKind {
V4ToV4,
V4ToV6,
V6ToV4,
V6ToV6,
DualToDual,
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Dual -> V4?
Why have this enum instead of struct SwitchKind { from: IpSupport, to: IpSupport }?

Or just pass from: IpSupport and to: IpSupport to run_switch_uplink.

@Frando Frando force-pushed the Frando/patchbay-switch-uplink branch from 509504b to b0e837f Compare April 14, 2026 10:22
Frando and others added 3 commits April 14, 2026 12:27
Pass `from: IpSupport` and `to: IpSupport` directly to run_switch_uplink
instead of using a SwitchKind enum. Covers the full 3x3 matrix of IP
family transitions (18 tests), adding the 8 previously missing cross
combinations (Dual<->V4, Dual<->V6, V4->Dual, V6->Dual).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collect all known remote addrs before the switch and reject any path
that was already open. This fixes a measurement artifact where
dual-stack "from" tests would instantly match on a pre-existing backup
IP path before the real re-holepunch completed.
Copy link
Copy Markdown
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Good catch on the latest bug fix too.

Comment thread iroh/tests/patchbay/switch-uplink.rs
@Frando Frando merged commit d72f1cb into main Apr 14, 2026
30 of 32 checks passed
@github-project-automation github-project-automation bot moved this from 🚑 Needs Triage to ✅ Done in iroh Apr 14, 2026
@matheus23 matheus23 deleted the Frando/patchbay-switch-uplink branch April 14, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants