[Nexthop][fboss2-dev] fboss2-dev switchport access vlan: validate VLAN exists before commit#1179
Closed
hillol-nexthop wants to merge 2 commits into
Closed
Conversation
joseph5wu
reviewed
May 12, 2026
Contributor
joseph5wu
left a comment
There was a problem hiding this comment.
The vlan existence check looks good to me but I'm not sure why do we need the vlan to have interfaces before you can set a port with an access vlan? Wouldn't this cli be used to assign the vlan to a port/interface?
Contributor
Author
Yes you are right. I have changed it. |
0473660 to
af1d442
Compare
Signed-off-by: mabel-bot[bot] <266911995+mabel-bot[bot]@users.noreply.github.com>
af1d442 to
d7f89e2
Compare
2 tasks
d7f89e2 to
041142e
Compare
meta-codesync Bot
pushed a commit
that referenced
this pull request
May 18, 2026
Summary: Remove `fboss/cli/fboss2/test/integration_test/ConfigSessionRestartTest.cpp` and its references in the cmake and BUCK file lists. This test is redundant — feature-specific integration tests (e.g. the switchport access vlan test) exercise the same config-session restart path. Split out from #1179 so the cleanup can land independently of the VLAN validation change. - `cmake/CliFboss2TestIntegrationTest.cmake`: drop entry. - `fboss/cli/fboss2/test/integration_test/BUCK`: drop entry. - `fboss/cli/fboss2/test/integration_test/ConfigSessionRestartTest.cpp`: delete. Pull Request resolved: #1202 Test Plan: - [x] `pre-commit run` - [x] Build still succeeds with the file and references removed. Differential Revision: D105598823 Pulled By: joseph5wu fbshipit-source-id: c9b34b7b5e95d23a2bbc6ca8251aa6221b368dbb
Contributor
|
@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D105998364. |
Contributor
|
@joseph5wu merged this pull request in 3132703. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
fboss2-dev config interface <name> switchport access vlan <id>blindly wroteingressVlanon the port and rewrote the matchingvlanPortsentry without checking that the target VLAN existed inconfig.sw()->vlans(). The CLI then printedConfig session committed successfullyand triggered a warmboot;fboss_sw_agentSIGABRTed during initialization with:Validate that the VLAN exists up front in
queryClient()and throwstd::invalid_argumentwith a descriptive message before touching the config or saving.CmdConfigInterfaceSwitchportAccessVlan.cpp: pre-flight check for VLAN existence.CmdConfigInterfaceSwitchportAccessVlanTest.cpp: fixture now seedssw.vlans; added a negative test for the rejection path and assert the running config is unchanged after the throw.Note: the redundant
ConfigSessionRestartTestremoval that previously rode along with this PR has been split out into #1202.Test plan
queryClientThrowsWhenVlanDoesNotExist, plus updated positive case still passes against the seeded VLAN.