Repository navigation
{Backup} Fix random password parsing in SQL snapshot tests - #34392
Naga Nandyala (naga-nandyala) merged 3 commits into
Conversation
Pass VM admin and SQL authentication passwords using option=value syntax so leading hyphens in token_urlsafe values cannot be interpreted as CLI options. Add regression coverage for both passwords and both VM setup paths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The test-setup password-handling change has no active review issues.
No open issues 🎉
What changed in this PR
Fixes intermittent password-parsing failures in Backup SQL instance snapshot test setup without changing production commands.
Changes:
- Attaches VM admin and SQL authentication passwords directly to their CLI options so leading hyphens are handled correctly.
- Adds 10 mocked regression cases covering normal, leading-hyphen, and underscore-prefixed passwords for seed and target VMs.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/backup/tests/latest/test_sql_instance_test_setup.py |
Adds regression coverage for password parsing and seed/target setup. |
src/azure-cli/azure/cli/command_modules/backup/tests/latest/sql_instance_test_setup.py |
Uses --option="value" syntax for both password arguments. |
Review effort: Balanced
Remove the added regression test at the request of the PR author; retain only the two option=value fixes in the existing SQL snapshot setup helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Skip the 51 recorded scenarios failing after .NET 8 and PowerShell 7.4 reached their recorded end-of-life date on 2026-11-10. Use existing method-level unittest.skip decorators and document that runtimes and recordings need updating before re-enabling the tests. Leave production EOL validation and all other tests unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a948799
|
Build 372988 (https://dev.azure.com/azclitools/public/_build/results?buildId=372988) validates this PR. Cherry-picked the EOL test-skip commit from #34391 as a948799 so fresh CI can validate the Backup password fix without the 51 unrelated App Service EOL failures. The three App Service files exactly match the EOL fix. The Backup helper remains a two-line argument fix with no added regression-test file. These EOL changes temporarily appear in the diff and should drop out once #34391 lands in dev. Other independent failures remain possible. |
🤖 PR Validation —⚠️ Review suggested
This PR adds warning or check suppressions. Fix the underlying warning where possible and justify each remaining suppression in a code comment or the PR description.
50 added suppressions
src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_access_restriction_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_functionapp_commands.py@unittest.skip('Recorded runtime reached end-of-life on 2026-11-10; update runtime and re-record.')20 more not shown.
Related commands
az vm createandaz sql vm create, invoked by the Azure Backup SQL instance snapshot test setup.Why this PR
The SQL snapshot scenario intermittently fails during setup because a randomly generated password can begin with
-. The test passes the password as a separate CLI token, so the argument parser can interpret it as another option even though the command string quotes it.Build evidence
Pipeline run 20261110.17 (build 372908), job Test Rpm Package Azure Linux 4.0 (Beta) ARM64, failed in:
SqlInstanceSnapshotTests.test_backup_sql_instance_snapshot_primary_regionFailing task log (log 697) shows the initial error:
The full-test failure excerpt reported during the same investigation shows the equivalent SQL authentication error:
Setup then enters cleanup, where
sql_instance_test_setup.py:190attemptsbackup container unregisterand raises:That later cleanup exception masks the initial password-parsing failure. This PR addresses the initial setup failure; it does not suppress cleanup errors or claim to fix independent Backup service failures.
Fix
Exactly two changes in the existing
sql_instance_test_setup.pyhelper:Using
--option=valuebinds a leading-hyphen value to its option. Random password generation, recording redaction, cleanup behavior, and production CLI code remain unchanged. No additional test files, skips, or dependencies are included.Validation
git diff --checkpassed.History Notes
Test setup only; no customer-facing behavior change.