Enable kvmtest for Klish AAA CLI validation with VS DUT#22
Open
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
Open
Enable kvmtest for Klish AAA CLI validation with VS DUT#22devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
devin-ai-integration[bot] wants to merge 5 commits intomasterfrom
Conversation
Add Test stage to azure-pipelines.yml that runs klish_aaa tests on VS DUT after BuildVS completes. Uses sonic-mgmt branch devin/1771309030-klish-aaa-tests from arthur-cog-sonic/sonic-mgmt. The test stage: - Downloads VS build artifact - Sets up testbed with KVM VS DUT - Runs klish_aaa/test_klish_aaa.py pytest suite - Publishes test results and logs as artifacts Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Use targetPath in DownloadPipelineArtifact to control download location - Add diagnostic step to log agent environment (docker, KVM, paths) - Fix VS image path to use Pipeline.Workspace/artifacts/target/ - Auto-detect sonic-mgmt checkout directory (handles multi-checkout) - Add continueOnError for container and testbed setup steps - Reduce hardcoded sleep times - Consolidate test run command to avoid duplication Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
…pipefail Key fixes: - Add -d /data/sonic-vm to refresh-dut command (matches official template) - Remove continueOnError: true from testbed setup steps - Add set -eo pipefail inside docker exec so pytest failures propagate - Remove debug diagnostic steps (no longer needed) - Fail hard if docker-sonic-mgmt image is missing - Increase sleep times to 180s (matches official template) Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
Co-Authored-By: Arthur Poon <arthur.poon@windsurf.com>
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.
Why I did it
Enable the previously-disabled kvmtest Test stage in the CI pipeline to run Klish AAA CLI validation tests against a VS (Virtual Switch) DUT. This validates the AAA CLI commands implemented in sonic-mgmt-framework (branch
devin/1769734716-aaa-klish-cli).The test suite (
klish_aaa/test_klish_aaa.py) lives in sonic-mgmt on branchdevin/1771309030-klish-aaa-tests(sonic-mgmt PR #11).Link to Devin run: https://cisco-demo.devinenterprise.com/sessions/8afc9b7efc1144cd8f447ee401302b6d
Requested by: @arthurkkp-cog
Work item tracking
How I did it
sonic-mgmtrepository resource ref frommastertodevin/1771309030-klish-aaa-teststo pick up the Klish AAA test suite.sonic-buildpool:$(Pipeline.Workspace)/artifacts/data/sonic-mgmtdocker-sonic-mgmtcontainer (fails hard if image is missing)testbed-cli.sh refresh-dutwith-d /data/sonic-vmflag anddeploy-mgklish_aaa/test_klish_aaa.pyvia pytest withset -eo pipefailto propagate failuresUpdates since initial revision
Fix commit (
5415e96) — addressed Test stage failure from first pipeline run (Build 191):targetPath: $(Pipeline.Workspace)/artifactstoDownloadPipelineArtifact@2(previous default path../target/was incorrect in multi-checkout layout)continueOnError: trueon container setup and testbed setup steps to surface diagnosticsCI result: Build 192 passed all checks, but test artifact analysis revealed all 43 tests failed with
Host unreachable in the inventory— the VS DUT was never deployed. ThecontinueOnError: trueand| teepiping masked the failures.Fix commit (
09b7a1d) — addressed DUT unreachable root cause:-d /data/sonic-vmflag totestbed-cli.sh refresh-dut(matching the officialrun-test-template.yml)continueOnError: truefrom "Setup sonic-mgmt container" and "Setup testbed" steps so failures are no longer maskedset -eo pipefailinsidedocker execso pytest failures propagate through| teedocker-sonic-mgmtimage is missing (no fallback to agent)CI result: Build 193 — BuildVS passed; Test stage now correctly fails instead of masking errors. Failures are properly surfaced.
Fix commit (
8b69480) — post test results to GitHub PR:condition: succeededOrFailed()) that runs after artifact publishingHow to verify it
Trigger a pipeline run on this branch and verify:
sonic-buildimage.kvmtest.klish_aaa.log@<attempt>) to confirm tests ranWhich release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
devin/1771314238-klish-aaa-kvmtest— CI passed but tests did not execute (DUT unreachable)devin/1771314238-klish-aaa-kvmtest— BuildVS passed; Test stage correctly fails (failures now properly surfaced)Description for the changelog
Enable kvmtest pipeline stage to run Klish AAA CLI validation tests on VS DUT using self-hosted sonic-build agent. Post test results directly to GitHub PR comments.
Link to config_db schema for YANG module changes
N/A
🚨 BLOCKER: Hardcoded feature branch reference
ref: devin/1771309030-klish-aaa-tests— This PR points the sonic-mgmt resource at a feature branch instead ofmaster. If merged as-is, ALL future pipeline runs (not just this PR) would use this feature branch. This is almost certainly not intended.master.❓ Test stage still failing (Build 193)
09b7a1d) successfully removed error masking, so failures are now properly surfaced. However, the Test stage is still failing, indicating real infrastructure issues:sonic-buildagent, missingdocker-sonic-mgmtimage, network/resource constraints🔐 GitHub token extraction is fragile
http.https://github.com/.extraheader)set -x, which could expose it in pipeline logs. Consider usingset +xaround sensitive operations.🧹 Missing cleanup for persistent agent
sonic-buildagent is persistent (not ephemeral). The pipeline doesn't clean up:testbed-cli.sh refresh-dut(left running after tests)/data/sonic-mgmtand/data/sonic-vmdirectories (accumulate across runs)docker-sonic-mgmtcontainer (left running withsleep infinity)finallyblock or as a separate cleanup job) before merging any similar pipeline changes to master. Consider using the officialcleanup.ymltemplate or adding explicittestbed-cli.sh remove-topoanddocker stop/rmsteps.✅ Resolved: continueOnError masking failures
continueOnError: truehas been addressed in commit09b7a1d. Testbed setup failures will now properly fail the pipeline.Minor items:
$(System.PullRequest.PullRequestNumber)variable may not be set if Azure DevOps doesn't recognize this as a PR build, in which case the GitHub comment posting is skipped (graceful fallback).