feat: add NX-OS to controller registry for architecture detection - #895
feat: add NX-OS to controller registry for architecture detection#895ChristopherJHart wants to merge 2 commits into
Conversation
537d56e to
7ca616f
Compare
oboehmer
left a comment
There was a problem hiding this comment.
Thanks for the PR. Can you please align this implementation to the controller detection refactor branch feat/856-controller-resolution-refactor/PR #896 ? This PR still requires a 2nd review from Andrea, but I wouldn't expect major changes.
…tection Registers NX-OS as an architecture context so the orchestrator can detect and route NX-OS D2D (SSH) operational tests. Aligned to the controller-resolution refactor (netascode#896): the registry now lives in nac_test/core/controller.py and CredentialSet uses the kind -> env var `fields` mapping rather than a positional `env_vars` tuple. Follows the IOS-XE direct-device pattern, with two deliberate differences: - Uses NXOS_HOST only. IOSXE carries both IOSXE_URL and IOSXE_HOST because IOSXE_URL is being phased out; there is no reason for a new architecture to inherit the retiring variable. url_env_var is set to NXOS_HOST so get_controller_url() resolves on the primary path. - Device SSH credentials (NXOS_USERNAME/NXOS_PASSWORD) are part of the credential set, matching IOSXE. Detection requires all env vars in a set, so this makes credentials mandatory rather than URL-only. NXOSTestBase is already mapped to "d2d" in BASE_CLASS_MAPPING, and NXOS needs no entry in _get_auth_callable() - direct device access has no controller to pre-flight against, same as IOSXE. AI-Generated: yes AI-Tool: claude-code AI-Model: claude-opus-5 AI-Percent: 96 AI-Reason: controller registry addition + test sweep
7ca616f to
e4bb574
Compare
|
Thanks for the review @oboehmer — I've force-pushed this branch, realigned to the controller-resolution refactor from #896 (now merged), and opened a companion PR for a doc inconsistency I found along the way. Realigned to #896Since #896 landed while this was in review, I rebuilt the change on current
Two changes from the original diff1. 2. Device credentials are now required for detection. The original diff had a URL-only credential set, which — since detection requires all env vars in a set to be present — meant For anyone else reading: the Companion PR: #936While checking the naming, I found I left the ACI and NDFC rows on Nothing else needed
Verification
Diff is now 5 files, +55/−2. Ready for Andrea's second review whenever convenient. |
|
Small correction to my comment above: the doc work is now split across two PRs rather than one.
I had bundled both into #936. They have different audiences — the env var name is a naming decision tied to this PR, while the example refresh is mechanical cleanup from #896 — so they're easier to review apart. Neither blocks this PR, and #937 doesn't depend on #895 merging. |
oboehmer
left a comment
There was a problem hiding this comment.
Thanks for aligning this to the new refactored code, @ChristopherJHart .. I can't look at your original changes, but it looks cleaner.. If you could make one more small change before merging then we reduce the maintenance burden even further (and add test coverage).
Replace the static set of expected controller names with get_args(ControllerTypeKey) so the test stays in sync automatically when new controller types are added. Addresses review feedback from oboehmer on PR netascode#895. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> AI-Generated: yes AI-Tool: claude-code AI-Model: claude-opus-4-6 AI-Percent: 27 AI-Reason: review feedback - derive expected controllers from type
Summary
"NXOS"toControllerTypeKeyliteral typeNXOS_URLis setMotivation
NX-OS D2D (SSH) operational tests need the orchestrator to recognize NX-OS as a valid architecture context. This follows the same direct-device pattern as IOS-XE (requires only an environment variable for detection, no controller authentication).
Changes
nac_test/core/types.py"NXOS"toControllerTypeKeynac_test/utils/controller.pyCONTROLLER_REGISTRYTest plan
🤖 Generated with Claude Code
🤖 AI Generation Metadata