Repository navigation
Conversation
NSO's tests, and any team's, can now run a physical attachment end to end. The test realizer programs a simulated switch from each SwitchPortHold and follows the realizer contract: it carries a boot claim's network alone and untagged, moves a port in one change, withdraws Programmed before changing a port, counts a change only once it reads it back, and removes the detach finalizer only once the port no longer carries the claim's network. It runs in a cell only when explicitly enabled. Key changes: - add vlanID to the interface and claim status for the VLAN a physical network arrives on - add the physicalrealizer package: a one-port switch driver, an in-memory simulated switch with failure hooks and a change history, and a reconciler keyed by SwitchPortHold that reads holds and claims from the API server - add physicalRealizer.enabled and driver to the cell config, off by default - add PortChanging, BootAttachmentActive, PortCarriesNetwork and AttachmentPointAccepted to the API and the network-agent catalog - cover handover, release, a claim deleted mid-change, partial and failed changes, unreadable switches, failed withdrawals and port safety with envtest through the real claim controller Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the test realizer found that a port could keep a network after its hold vanished, that VLANs moved when another claim left, and that the project copy of an interface dropped its VLAN. Key changes: - sweep every port no hold names, on start, every 30 seconds and whenever a hold is gone, withdrawing its claims before clearing it; the realizer runs with one worker so the sweep and per-hold passes never race on a port - refuse a hold whose name is not its port's, and let it protect no port - tag every network claim on a VLAN hashed from its network, probed in name order, so a surviving claim keeps its VLAN - copy vlanID to the project copy of an interface - drop the unused PortUnverified reason - warn at startup that the simulated realizer programs nothing real, and log failed changes, mismatched read-backs, kept finalizers and swept ports - check port safety before every change in the tests, and cover the sweep, the name check, VLAN stability and NSO's status writes keeping what the realizer reports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
force-pushed
the
feat/physical-test-realizer
branch
from
November 26, 2026 22:22
f709d35 to
81f1511
Compare
scotwells
force-pushed
the
feat/physical-port-holds
branch
from
November 26, 2026 22:22
ccdc09f to
f26e1b2
Compare
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
Physical claims bind and hold their port, but nothing yet changes a switch port, so no physical claim could ever report that its port carries its network. This adds a test realizer that programs a simulated switch, off by default, so NSO's tests and Fleet's can run a server attachment and a boot-to-customer handover end to end without real switches.
It follows the design's four safety rules: it withdraws Programmed before changing a port, counts a change only once the port reads back, rechecks for deleted claims after each change, and never removes a finalizer it cannot prove. Interfaces and claims now report the VLAN each network arrives on, and a periodic sweep clears any port no hold names.
Decisions for a person
Test plan
Related to #963
🤖 Generated with Claude Code