Skip to content

[Nexthop][fboss2] Remove redundant ConfigSessionRestartTest#1202

Closed
hillol-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:hillol/remove-config-session-restart-test
Closed

[Nexthop][fboss2] Remove redundant ConfigSessionRestartTest#1202
hillol-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:hillol/remove-config-session-restart-test

Conversation

@hillol-nexthop
Copy link
Copy Markdown
Contributor

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.

Test plan

  • pre-commit run
  • Build still succeeds with the file and references removed.

Port upstream removal of fboss/cli/fboss2/test/integration_test/
ConfigSessionRestartTest.cpp and its references (cmake and BUCK file
lists) from facebook#1095.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 18, 2026

@joseph5wu has imported this pull request. If you are a Meta employee, you can view this in D105598823.

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 18, 2026

@joseph5wu merged this pull request in 6a22d64.

meta-codesync Bot pushed a commit that referenced this pull request May 21, 2026
…#1179)

Summary:
**Pre-submission checklist**
- [x] I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running `pip install -r requirements-dev.txt && pre-commit install`
- [x] `pre-commit run`

`fboss2-dev config interface <name> switchport access vlan <id>` blindly wrote `ingressVlan` on the port and rewrote the matching `vlanPorts` entry without checking that the target VLAN existed in `config.sw()->vlans()`. The CLI then printed `Config session committed successfully` and triggered a warmboot; `fboss_sw_agent` SIGABRTed during initialization with:

```
switch initialization failed: VLAN <id> has no interface, even when corresp port <port> is enabled
```

Validate that the VLAN exists up front in `queryClient()` and throw `std::invalid_argument` with a descriptive message before touching the config or saving.

- `CmdConfigInterfaceSwitchportAccessVlan.cpp`: pre-flight check for VLAN existence.
- `CmdConfigInterfaceSwitchportAccessVlanTest.cpp`: fixture now seeds `sw.vlans`; added a negative test for the rejection path and assert the running config is unchanged after the throw.

Note: the redundant `ConfigSessionRestartTest` removal that previously rode along with this PR has been split out into #1202.

Pull Request resolved: #1179

Test Plan: - [x] Unit tests: `queryClientThrowsWhenVlanDoesNotExist`, plus updated positive case still passes against the seeded VLAN.

Reviewed By: Scott8440

Differential Revision: D105998364

Pulled By: joseph5wu

fbshipit-source-id: 3f2ac3eb3ade5e34f828c0c79e036669e21f650a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant