Skip to content

RANGER-5175:Functional Test Case Support for KMS API and HDFS Encryption#881

Open
ChinmayHegde24 wants to merge 1 commit intoapache:masterfrom
ChinmayHegde24:Pytest-FT
Open

RANGER-5175:Functional Test Case Support for KMS API and HDFS Encryption#881
ChinmayHegde24 wants to merge 1 commit intoapache:masterfrom
ChinmayHegde24:Pytest-FT

Conversation

@ChinmayHegde24
Copy link
Contributor

Pytest Functional Test-suite

This test suite validates REST API endpoints for KMS (Key Management Service) and tests HDFS encryption functionalities including key management and file operations within encryption zones.

hdfs : contains test cases for checking KMS functionality through hdfs encryption lifecycle

kms : contains test cases for checking KMS API functionality

Directory Structure

pytest-Tests/
├── hdfs/                    # Tests on HDFS encryption cycle
├── kms/                     # Tests on KMS API
├── pytest.ini               # Registers custom pytest markers
├── run_tests.sh             # Script to automate test execution
├── requirements.txt
├── readme.md

Running Tests

Container Setup

Before running the tests, configure container behaviour using the following environment variable:

  # To force a fresh container setup:
  export CLEAN_CONTAINERS=1

After the initial setup, you can disable fresh container creation by setting below for the next re-runs:

  export CLEAN_CONTAINERS=0

Executing Tests

Run the test script using:

  ./run-tests.sh [db-type] [additional-services]
  
  # valid values for db-type: mysql/postgres/oracle , postgres is the default
  # additional-services: multiple services can be specified separated by space
  
  # e.g for running tests within kms and hdfs use below command:
  
  ./run-tests.sh postgres hadoop
  
  # Note: If additional-services are specified, db-type must also be explicitly specified

Note (Optional)

If you only need to start the infrastructure i.e containers (without running tests):

  export RUN_TESTS=0

This is useful when tests are failing due to incomplete container setup.

After the infrastructure is successfully up, set RUN_TESTS=1 and rerun the script to execute the tests without setup issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant