Conversation
… 3 cleanup (#897, #914, #917, #918) - Remove transitional fallback from get_controller_context() - Delete deprecated nac_test/utils/controller.py shim - Clean up test suite to use resolve_and_inject_context and inject_context fixtures - Update dev-docs/PRD_AND_ARCHITECTURE.md to reflect SSOT controller resolution
Ensure controller context is present in os.environ for auth adapters (such as SDWANManagerAuth) that read get_controller_context() during preflight validation.
… polish docstrings
NACTestBase.setup() requires NAC_TEST_CONTROLLER_CONTEXT since the Phase 3 fallback removal. Patching NACTestBase.setup masked this on Python 3.12/3.13 but not on 3.10, where pyATS binds @aetest.setup at import time and super().setup() bypasses the class-level patch. Refs #954
oboehmer
marked this pull request as ready for review
September 14, 2026 10:08
36 tasks
oboehmer
added a commit
to netascode/nac-test-pyats-common
that referenced
this pull request
Sep 14, 2026
…tract Phase 3 removes the transitional fallback in nac-test's get_controller_context(), so SDWANManagerAuth.get_auth() now hard-fails outside an orchestrated run. The docs and tests did not reflect that. - Document get_auth() as orchestrator-only in both the module and method docstrings: the controller context is resolved by nac-test via resolve_controller() and passed through NAC_TEST_CONTROLLER_CONTEXT, so exporting SDWAN_* credentials alone is no longer sufficient. - List NAC_TEST_CONTROLLER_CONTEXT as a requirement and add the missing-context ValueError to Raises:. - Remove the get_auth() doctest examples. They demonstrated standalone credential-only usage, which is no longer a valid use case and now raises. Doctests are not collected, so nothing caught the drift. - Add TestControllerContextRequired, which deliberately does not mock get_controller_context(). It is the only test that distinguishes a Phase 3 nac-test from a Phase 2 one: against Phase 2 the deprecated detect_controller_type() fallback resolves SDWAN from the credentials and get_auth() attempts a real connection instead of raising. Expected to fail until the nac-test pin is bumped. - Correct stale references in dev-docs/PRD_AND_ARCHITECTURE.md: the deleted nac_test/utils/controller.py, a hardcoded absolute path, and two flow diagrams that attributed the UNKNOWN fallback to get_controller_context() rather than to the except in IOSXETestBase. Refs netascode/nac-test#897 Depends on netascode/nac-test#953
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.
Description
Complete Phase 3 controller cleanup by removing transitional fallbacks, deleting the deprecated
nac_test.utils.controllershim, updating test suites to use unified context fixtures, and aligning documentation with the SSOT controller registry architecture.Closes
Related Issue(s)
Type of Change
Test Framework Affected
Network as Code (NaC) Architecture Affected
Platform Tested
Key Changes
get_controller_context(), enforcing that controller identity must be resolved by the orchestrator and passed viaNAC_TEST_CONTROLLER_CONTEXT.nac_test/utils/controller.pyshim.NAC_TEST_CONTROLLER_CONTEXTinpreflight_auth_check()for auth adapters (e.g.,SDWANManagerAuth) readingget_controller_context().resolve_and_inject_contextandinject_contexthelper fixtures intests/conftest.py.dev-docs/PRD_AND_ARCHITECTURE.mdto reflectresolve_controller() -> ControllerContextand SSOT controller resolution.Testing Done
pytest/pre-commit run -a)Test Commands Used
Checklist
pre-commit run -apasses)Additional Notes
Paired with
nac-test-pyats-commonbranchrefactor/controller-phase3-cleanup.