Skip to content

test(interop): prove import next-hop self on the wire - #2979

Merged
lance0 merged 3 commits into
mainfrom
test/interop-import-next-hop-self
Oct 8, 2026
Merged

lance0 merged 3 commits into
mainfrom
test/interop-import-next-hop-self

Conversation

@lance0

@lance0 lance0 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Depends on #2978. M114 fails on main until #2978 lands, so keep this draft until that merges.

What it adds

M114 is a containerlab leg for import next-hop self. The topology:

  • an FRR eBGP source (AS 65002) sends two IPv4 prefixes to rustbgpd (AS 65001);
  • rustbgpd's inline import policy sets next-hop self on 198.51.100.0/24 and leaves the control prefix 198.51.101.0/24 unchanged;
  • two FRR 10.7.1 receivers take the routes, one over iBGP and one as a route_server_client.

The driver asserts the following:

  • rustbgpd's best routes carry 10.114.0.1, the local address of the source session, for the rewritten prefix, and 10.114.0.2 for the control prefix. This passes on main too, which places the defect in export.
  • Each receiver's pre-policy Adj-RIB-In (received-routes, with soft-reconfiguration inbound) holds 10.114.0.1 for the rewritten prefix and 10.114.0.2 for the control prefix.
  • A tshark sidecar in rustbgpd's namespace, built from the existing Dockerfile.bmpsink, checks every UPDATE that carries either prefix to either receiver. Each such UPDATE must have exactly one NEXT_HOP attribute with the expected address and no MP_REACH_NLRI. The capture must also contain no NOTIFICATION.
  • Both receiver sessions stay on their first connection.

The job is wired into interop.yml as m114, with a single attempt and no retry. It is listed in docs/interop.md.

Local results

Each run below used a fresh deployment of this branch's topology and driver.

origin/main (a2c741431): 19 passed, 4 failed. Both receivers get the received next hop:

FAIL frr-ibgp received 198.51.100.0/24 with next hop '10.114.0.2', expected 10.114.0.1
FAIL frr-rs received 198.51.100.0/24 with next hop '10.114.0.2', expected 10.114.0.1
FAIL wire: to 10.114.1.2 198.51.100.0/24: 1 UPDATE(s), NEXT_HOP counts [1], MP_REACH counts [0], next hops ['10.114.0.2']
FAIL wire: to 10.114.2.2 198.51.100.0/24: 1 UPDATE(s), NEXT_HOP counts [1], MP_REACH counts [0], next hops ['10.114.0.2']

origin/main merged with #2978 (934a0dba5): 23 passed, 0 failed.

Scope

Extended Next Hop is not negotiated in this lab, so the IPv4 MP_REACH fallback that #2978 also fixes remains covered by its unit tests only. FRR advertises Extended Next Hop only over IPv6 transport.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The wire checker can pass after parser failure or overlook MP_REACH-only advertisements.

2 open findings
What changed in this PR

Adds M114 interoperability coverage for #2978, verifying import next-hop self reaches iBGP and route-server clients correctly.

Changes:

  • Adds an FRR topology with rewritten and unchanged control prefixes.
  • Checks receiver routes, captured UPDATEs, and session stability.
  • Registers a single-attempt CI job and documents coverage.
File Description
tests/​interop/​scripts/​test-m114-import-next-hop-self-frr.sh Runs route, wire, and session assertions.
tests/​interop/​m114-import-next-hop-self-frr.clab.yml Defines the four-node lab.
tests/​interop/​configs/​rustbgpd-m114-import-next-hop-self.toml Configures import rewriting and passthrough peers.
tests/​interop/​configs/​frr-bgpd-m114-source.conf Advertises test and control prefixes.
tests/​interop/​configs/​frr-bgpd-m114-rs.conf Configures the route-server receiver.
tests/​interop/​configs/​frr-bgpd-m114-ibgp.conf Configures the iBGP receiver.
docs/​interop.md Documents M114 coverage and limitations.
.github/​workflows/​interop.yml Adds M114 to required interop checks.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread tests/interop/scripts/test-m114-import-next-hop-self-frr.sh Outdated
notifications += 1
if kind[0].get("show") != "2":
continue
codes = [f.get("show") for f in fields(bgp, "bgp.update.path_attribute.type_code")]

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues remain, and prerequisite #2978 is confirmed merged.

1 open finding
1 resolved since last review

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@lance0
lance0 marked this pull request as ready for review October 8, 2026 00:50
@lance0
lance0 merged commit 099a41d into main Oct 8, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants