[Nexthop][fboss2-dev] Create VLANs on the fly in "config vlan" and "switchport access vlan" - #1407
Open
benoit-nexthop wants to merge 1 commit into
Open
[Nexthop][fboss2-dev] Create VLANs on the fly in "config vlan" and "switchport access vlan"#1407benoit-nexthop wants to merge 1 commit into
benoit-nexthop wants to merge 1 commit into
Conversation
# Summary "config vlan 4005" with no subcommand used to fail with "Incomplete command, please use one of the subcommands", and "config interface <port> switchport access vlan <id>" refused to run when the VLAN didn't exist. Both now create the VLAN (and its barebone interface) via VlanManager::createVlan() in the config session: - config vlan <id>: creates the VLAN, or reports "already exists". Implementation moved from the inline stub in CmdConfigVlan.h to CmdConfigVlan.cpp. - config interface <port> switchport access vlan <id>: auto-creates a missing VLAN and notes "(VLAN <id> created)" in the output. Add CmdConfigVlanTest.cpp covering creation (including persistence of the session config to disk) and idempotency, and rewrite the switchport access vlan "throws when VLAN missing" test to verify the new auto-create behavior. # Test Plan Add a new unit test / update existing unit test. Tested on wedge800bnhp: "config vlan 4005" and "switchport access vlan 4021" both create the VLAN + fbossNNNN interface, visible in "config session diff"; re-running reports the VLAN already exists.
Contributor
|
@benoit-nexthop this PR failed the GHA build fboss2 cli job, can you fix it? |
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.
Summary
"config vlan 4005" with no subcommand used to fail with "Incomplete command, please use one of the subcommands", and "config interface switchport access vlan " refused to run when the VLAN didn't exist. Both now create the VLAN (and its barebone interface) via VlanManager::createVlan() in the config session:
Add CmdConfigVlanTest.cpp covering creation (including persistence of the session config to disk) and idempotency, and rewrite the switchport access vlan "throws when VLAN missing" test to verify the new auto-create behavior.
Test Plan
Add a new unit test / update existing unit test.
Tested on wedge800bnhp: "config vlan 4005" and "switchport access vlan 4021" both create the VLAN + fbossNNNN interface, visible in "config session diff"; re-running reports the VLAN already exists.