accessControl createBackup

Parameter Validation and Fallback Logic

Scénario de test & Cas d'usage

Business Context

During the development of an automated deployment script, a developer accidentally omits the destination path variable. The QA team needs to verify the robustness of the action's validation logic: ensuring that the action either fails gracefully with a clear error message when the path is missing (and tables=false), or accepts the command if the intention was purely in-memory. This test specifically targets the 'Required unless...' logic defined in the documentation.
About the Set : accessControl

Management of access rights and data security.

Discover all actions of accessControl
Data Preparation

Standard environment initialization.

Copied!
1PROC CAS;
2 SESSION casauto;
3 ACCESSCONTROL.assumeRole / adminRole='superuser';
4 RUN;

Étapes de réalisation

1
Attempting to run createBackup without any parameters (Edge Case: Expecting Failure).
Copied!
1PROC CAS;
2 /* Expect Error: Path is required by default */
3 ACCESSCONTROL.createBackup;
4 RUN;
2
Running createBackup with 'tables=true' but WITHOUT a 'path' (Edge Case: Expecting Success based on 'unless' clause).
Copied!
1PROC CAS;
2 /* Expect Success: Path is not required if tables=true */
3 ACCESSCONTROL.createBackup / tables=true;
4 RUN;

Expected Result


Step 1 should produce a severity error indicating the 'path' parameter is missing. Step 2 should execute successfully, proving that the 'path' requirement is conditionally waived when 'tables' is set to true, confirming the documentation's logic.