table addCaslibSubdir

Edge Case: Data Governance and Security Validation

Scénario de test & Cas d'usage

Business Context

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.
About the Set : table

Loading, saving, and managing in-memory tables.

Discover all actions of table
Data Preparation

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.

Copied!
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.
Copied!
1 
2PROC CAS;
3TABLE.addCaslibSubdir / caslib='nonExistentCaslib' path='should_fail';
4RUN;
5 
2
Attempt to create a subdirectory using an invalid permission string. The action should reject the unknown value.
Copied!
1 
2PROC CAS;
3TABLE.addCaslibSubdir / caslib='govTest' path='invalid_perms' permission='ALLOW_ALL';
4RUN;
5 
3
Attempt to create a subdirectory that already exists. The system should return a specific error or warning indicating the conflict.
Copied!
1 
2PROC CAS;
3TABLE.addCaslibSubdir / caslib='govTest' path='existing_folder';
4RUN;
5 
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.
Copied!
1 
2PROC CAS;
3TABLE.addCaslibSubdir / caslib='govTest' path='../attempted_escape';
4RUN;
5 

Expected Result


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.