test_hdfs/
├── test_encryption.py
├── test_encryption02.py
├── test_encryption03.py
├── test_config.py #stores all constants and HDFS commands
├── conftest.py #sets up the environment
├── utils.py #utility methods
- Markers:
Markers can be used to selectively run specific test cases, improving test efficiency and organization.
Handled in conftest.py file
Before running the test cases, some environment configurations are needed:
- HDFS must communicate with KMS to fetch key details.
- Specific KMS properties are added to the
core-site.xmlfile. - Containers are restarted to apply the changes effectively.
-
get_error_logs:
Fetches logs from both KMS and HDFS containers. Helps in identifying issues when errors or exceptions occur during testing. -
run_command:
Executes all necessary HDFS commands inside the containers.
Handles the full HDFS encryption cycle, including setup, positive and negative test scenarios, and cleanup.
- Encryption Zone (EZ) creation in HDFS.
- Granting permissions to specific users for read/write operations within the EZ.
- Validating read/write attempts by unauthorized users inside the EZ.
Handles the Check if after key roll over old files can be read or not Check if after key roll over new files can be written and read too Check read operation on file after key deletion
Handles the Test case on cross Encryption zone operations
This test suite ensures that HDFS encryption and access control mechanisms function as expected, validating both authorized and unauthorized access scenarios.