?>Array ( [id] => 62 ) Edge Case: Data Governance and Security Validation - WeAreCAS
table addCaslibSubdir

Edge Case: Data Governance and Security Validation

Scénario de test & Cas d'usage

Contexte Métier

A data governance team is stress-testing the CAS environment to ensure system integrity and security. They must verify that the `addCaslibSubdir` action fails gracefully and provides clear error messages when used with invalid parameters or in unauthorized ways.
Préparation des Données

Setup of a base caslib for testing. A subdirectory 'existing_folder' is also created to test behavior when attempting to create a directory that already exists.

Copié !
1PROC CAS;
2 caslib govTest path='/cas/data/gov' dataSource={srcType='path'};
3 TABLE.addCaslibSubdir / caslib='govTest' path='existing_folder';
4RUN;

Étapes de réalisation

1
Attempt to create a subdirectory in a caslib that does not exist. This should result in an error.
Copié !
1PROC CAS;
2 TABLE.addCaslibSubdir / caslib='nonExistentCaslib' path='should_fail';
3RUN;
2
Attempt to create a subdirectory using an invalid permission string. The action should reject the unknown value.
Copié !
1PROC CAS;
2 TABLE.addCaslibSubdir / caslib='govTest' path='invalid_perms' permission='ALLOW_ALL';
3RUN;
3
Attempt to create a subdirectory that already exists. The system should return a specific error or warning indicating the conflict.
Copié !
1PROC CAS;
2 TABLE.addCaslibSubdir / caslib='govTest' path='existing_folder';
3RUN;
4
Attempt to create a directory using a path that tries to escape the caslib's root (directory traversal). This should be blocked for security.
Copié !
1PROC CAS;
2 TABLE.addCaslibSubdir / caslib='govTest' path='../attempted_escape';
3RUN;

Résultat Attendu


Each test step is expected to fail. The SAS log for each step should contain a clear ERROR or WARNING message explaining the reason for failure: caslib not found, invalid permission value, directory already exists, or invalid path. The file system should remain unchanged by these failed attempts, demonstrating the action's robustness and security.