Skip to content

Cover port-channel generation - #2569

Merged
berendt merged 2 commits into
mainfrom
sonic-e2e-v2-portchannel
Sep 17, 2026
Merged

berendt merged 2 commits into
mainfrom
sonic-e2e-v2-portchannel

Conversation

@ideaship

@ideaship ideaship commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Part of the series tracked in #2562, which explains the ordering and what each PR covers. Based on the preceding PR in the stack, so review only the top commits here.

Scenario overlay for port-channels, covering PORTCHANNEL,
PORTCHANNEL_MEMBER and PORTCHANNEL_INTERFACE.

A second commit covers the BGP peering modes. The port-channel device
modelled an uncabled LAG, so both its BGP tables were empty and the neighbour
loops were never entered — no golden in the set distinguished a numbered
session from an unnumbered one. Two blocks are added: one cables both
PortChannel1 members to a peer whose side is a LAG as well, pinning the
port-channel peering unnumbered; the other gives the device a plain port with
no address facing a peer port that has one, which is link-local for the same
reason.

That second block also pins a shape worth knowing about before reading the
golden: the generator keys BGP_NEIGHBOR by the address found on the far end
but keys BGP_NEIGHBOR_AF by the interface, so the two halves of that session
point at different names. The change that would have derived both from one
decision was withdrawn as a fix without a reachable defect, and the check that
flagged it is reverted at the bottom of this stack. These goldens are now the
only place in tree where the shape is recorded.

@ideaship ideaship changed the title sonic e2e v2 portchannel Cover port-channel generation Aug 5, 2026
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from 18a6299 to 6513399 Compare August 5, 2026 15:10
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from 6513399 to 11756b8 Compare August 5, 2026 19:51
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from 11756b8 to a69029d Compare August 6, 2026 10:56
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from a69029d to d48d1df Compare August 6, 2026 12:10
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from d48d1df to 7029d37 Compare August 6, 2026 12:19
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from 7029d37 to 3b303bb Compare August 7, 2026 05:35
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from 3b303bb to 92fdab3 Compare August 7, 2026 08:07
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from 92fdab3 to 1e53c84 Compare August 7, 2026 08:59
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from 1e53c84 to 945ef2f Compare August 25, 2026 13:55
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from 945ef2f to af8e0ba Compare September 16, 2026 14:18
@ideaship
ideaship removed this pull request from stack #2572 September 16, 2026 14:27
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from af8e0ba to 24e8728 Compare September 16, 2026 15:02
@ideaship
ideaship force-pushed the sonic-e2e-v2-portchannel branch from 24e8728 to afcbf17 Compare September 16, 2026 15:11
@ideaship
ideaship added this pull request to stack #2704 September 16, 2026 15:50
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from afcbf17 to 098f1b5 Compare September 16, 2026 16:02
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from 098f1b5 to e994bc3 Compare September 16, 2026 18:05
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from e994bc3 to ae28276 Compare September 16, 2026 19:28
Base automatically changed from sonic-e2e-v2-breakout-declared to main September 17, 2026 06:01
Add a port-channel (LAG) device to the SONiC E2E synthetic
fixtures. Until now the base/breakout fixtures modelled no LAGs, so
PORTCHANNEL, PORTCHANNEL_INTERFACE and PORTCHANNEL_MEMBER were
emitted by the generator but always empty in every golden -- that
code path had no coverage.

e2e-portchannel (rack E2E, position 9, edgecore-7726-32x-e2e /
Accton-AS7726-32X, role leaf) reuses the site/location/tenant/tag
objects created by 100-base.yml. It bonds Ethernet0 and Ethernet4
into PortChannel1: a NetBox LAG interface (type: lag) with the two
data ports referencing it via their lag field, the same way real
deployments model a port-channel.

This brings cumulative non-empty config_db table coverage across
the golden set from 32 to 35 of the 38 tables the generator emits
(only the VXLAN EVPN/tunnel tables remain uncovered). Verified with
a full down/regen/verify cycle against a freshly started NetBox
stack, so the goldens reflect a from-scratch database rather than
an UPDATE over a reused one.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
Nothing in the golden set distinguished a numbered BGP session from an
unnumbered one on the paths that generate most of them. e2e-portchannel
modelled an uncabled LAG, so its BGP_NEIGHBOR and BGP_NEIGHBOR_AF were
both empty -- get_connected_interfaces() marks a port channel connected
only when a member is cabled, so those loops were never entered at all.
No fixture reached the shape where an interface carries no address of
its own while the endpoint it faces carries one, which is where the
neighbour identity and the address family selection can disagree.

Two blocks are added to 600-portchannel.yml.

The first cables both members of PortChannel1 to e2e-metalbox-1, whose
side is a LAG as well: an aggregate cabled to two standalone routed
ports would not form. The peer address sits on that aggregate, not on
the cabled members, which is the conventional way to model it. Two
lookups would have to reach it and neither does -- the resolver's LAG
member fallback is off for BGP on purpose, and nothing follows a member
up to the peer's own aggregate -- so this pins the port channel peering
unnumbered, and it moves the day either lookup changes. The numbered
port-channel case cannot be reached from NetBox data at all, since a
LAG interface is not cablable; the unit tests pin that one.

The second gives the device a plain port with no address facing a
metalbox port that has one, outside any Transfer prefix. With no local
address there is nothing to source a numbered session from, so the
peering is link-local and both address families are activated on
Ethernet8. The two tables do not agree on who the peer is: the
neighbour is keyed by the address found on the far end while the
address families are keyed by the interface, so the golden records a
session whose halves point at different names. That disagreement is as
much the reason for this block as the peering mode is -- nothing else
in tree captures it, and it moves the day the two are derived from one
decision.

e2e-metalbox-1 is the peer in both because it has no SONiC role and no
managed-by-metalbox tag, so it never gets a golden of its own and the
churn stays in this device's golden.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
@berendt
berendt force-pushed the sonic-e2e-v2-portchannel branch from ae28276 to d07d744 Compare September 17, 2026 06:01
@ideaship
ideaship marked this pull request as ready for review September 17, 2026 06:54
@ideaship
ideaship requested a review from berendt September 17, 2026 06:54

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@berendt
berendt merged commit ff8d28b into main Sep 17, 2026
3 checks passed
@berendt
berendt deleted the sonic-e2e-v2-portchannel branch September 17, 2026 11:29
@github-project-automation github-project-automation Bot moved this from New to Done in Human Board Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants