Repository navigation
[Nexthop] [fboss2] Insert vlanPorts membership in switchport access vlan - #1451
hillol-nexthop wants to merge 1 commit into
Conversation
|
This pull request has been imported. If you are a Meta employee, you can view this in D114555610. (Because this pull request was imported automatically, there will not be any future comments.) |
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
1 similar comment
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
9f003e5 to
b6fb1f3
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
b6fb1f3 to
4502877
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
4502877 to
e5d0ebd
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
e5d0ebd to
cd2a473
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
|
Note on |
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
joseph5wu
left a comment
There was a problem hiding this comment.
I strongly recommend to move the new snapshop test config for integration test out of this PR and have a new one to take care of it.
Besides, I don't think we should make Fboss2IntegrationTest to introduce the snapshop/restore config feature. Instead, we should consider to use ConfigSession::rollback(). I would also like to see whether rollback can take care of this case as expected(whether it needs coldboot or warmboot)
cc: @benoit-nexthop
fa60b9e to
defc836
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
defc836 to
630367d
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
630367d to
d6a1c02
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
d6a1c02 to
bf02909
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
bf02909 to
c3fc618
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
c3fc618 to
1f5f3c1
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
`config interface <name> switchport access vlan <id>` set sw.ports[].ingressVlan and retargeted existing sw.vlanPorts[] entries, but never inserted one when the port had no membership, leaving a config the agent validator rejects (port not a member of its ingress VLAN). A port with several entries had all of them retargeted, producing duplicate (vlan, port) pairs. The command now leaves each port with exactly one untagged vlanPorts membership in the target VLAN: stale untagged memberships are removed, an existing entry in the target VLAN is deduplicated, the new untagged entry is inserted, tagged (trunk) memberships elsewhere are preserved. ConfigVlanSwitchportAccessTest becomes NewVlanAcrossPorts: attach a new VLAN to one port (auto-create + insert), then the existing VLAN to a second port, verifying ingressVlan and the untagged membership after each commit. No manual unwind: the harness's per-suite config containment (run_test.py suite hooks, meta#1557) rolls the DUT back to the pre-suite baseline after the suite ends. Signed-off-by: hillol-nexthop <hillol@nexthop.ai> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1f5f3c1 to
88f30b7
Compare
|
@hillol-nexthop has updated the pull request. You must reimport the pull request before landing. |
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
config interface <name> switchport access vlan <id>setsw.ports[].ingressVlanand retargeted existingsw.vlanPorts[]entries, but never inserted one when the port had no membership — leaving a config where the port is not a member of its ingress VLAN (rejected by the agent config validator). A port with multiple entries also got all of them retargeted, producing duplicate(vlan, port)pairs.The command now leaves each port with exactly one untagged
vlanPortsmembership in the target VLAN:Integration test redesign
ConfigVlanSwitchportAccessTestis redesigned as NewVlanAcrossPorts: attach a brand-new VLAN to one port (auto-create + insert path end to end), then the now-existing VLAN to a second port; after each warmboot commit verifyingressVlanand the untaggedvlanPortsmembership via the agent's running config.Teardown
No manual unwind: the test harness's per-suite config containment (#1557) records the
/etc/coopbaseline before the suite starts and rolls the DUT back to it after the suite ends, so the device is left as found even when the test fails mid-way.Port selection
NewVlanAcrossPortsneeds two distinct ports; it calls the existinggetRandomInterfacePortName()twice (retrying until the names differ) — no new fixture helper.Test Plan
//fboss/cli/fboss2/test/config:cmd_config_test— 17/17 pass, including new UTs: insertion when membership missing, dedup of conflicting entries, idempotency, trunk-membership preservation, membership on VLAN auto-create.ConfigVlanSwitchportAccessTest.NewVlanAcrossPorts— PASS (binary built from our internal tree carrying the identical test body). Both VLAN commits were recorded asAGENT_WARMBOOTincli/cli_metadata.json, agents active after each commit, and the config was rolled back to the pre-suite baseline afterwards with no test residue incli/agent.conf.