Test Case ID | Test Objective | Test Steps | Expected Outcome | Test Type |
|---|
TC-001 | Verify that API integration enforces token-based authentication. (User Flow, Authenticated) | Generate a valid authentication token via Airflow CLI and the main sign-in page airflow auth login --api-url=https://example-url - Check if the token is placed properly under its directories ~/.airflow/config
Execute a CLI command (e.g., airflow dags list). Capture the API request sent by the CLI. Verify response executed the requested command properly (e.g. dags list).
| The API processes the request successfully, and the CLI outputs the correct result. | Positive |
TC-002 | Verify that API integration enforces token-based authentication. (User Flow, Unauthenticated)
| - Ensure there isn't any authentication from CLI ~/.airflow/config
Execute the CLI command (e.g., airflow dags list). Capture the API request sent by the CLI. Verify CLI displays an appropriate error message.
| The API returns an authentication error, and the CLI displays an appropriate error message. | Negative |
TC-003 | Verify that API integration enforces token-based authentication. (Automated Flow, Authenticated) | - Create the user as an automated user
- Generate tokens for automated users with respective expiration dates.
Generate a valid authentication token via Airflow CLI and the main sign-in page airflow auth configure --api-url=https://example-url --token=<valid_token> - Check if the token is placed properly under its directories ~/.airflow/config
Execute a CLI command (e.g., airflow dags list). Capture the API request sent by the CLI. Verify response executed the requested command properly (e.g. dags list).
| The API processes the request successfully, and the CLI outputs the correct result.
| Positive |
TC-004 | Verify that API integration enforces token-based authentication. (Automated Flow, Unauthenticated) | - Ensure there isn't any authentication from CLI ~/.airflow/config
Execute the CLI command (e.g., airflow dags list --token=<invalid_token> OR AIRFLOW_CLI_TOKEN=<TOKEN> airflow dags list). Capture the API request sent by the CLI. Verify CLI displays an appropriate error message.
| The API returns an authentication error, and the CLI displays an appropriate error message. | Negative |
TC-005 | Verify that API integration respects RBAC policies. | Assign a user to a role with limited permissions (e.g., don't have permission can view DAGs ). - Ensure CLI is authenticated.
Execute CLI command airflow dags list Verify CLI displays an appropriate error message.
| Restricted actions fail with an authorization error. | Negative |
TC-006 | Verify that API integration respects RBAC policies. | Assign a user to a role with limited permissions (e.g., don't have permission can view DAGs ). - Ensure CLI is authenticated.
Execute CLI command airflow dags list Verify response executed the requested command properly dags list .
| Allowed actions succeed and return the correct data. | Positive |
TC-007 | Ensure that the CLI handles API downtime gracefully. | Simulate API downtime (e.g., stop the API service or block network access). - Ensure CLI is authenticated.
Execute a CLI command (e.g., airflow dags list). Observe the CLI behaviour and error messages.
| The CLI displays a clear and user-friendly error message indicating that the API is unavailable.
| Edge |
TC-008 | Ensure that sensitive data is not exposed in CLI outputs or API responses. | - Ensure CLI is authenticated.
Execute a CLI command that interacts with sensitive data (e.g., airflow connections list). Review the CLI output for any sensitive information (e.g., passwords, tokens). Capture the corresponding API response and check for sensitive data exposure.
| Neither the CLI output nor the API response exposes sensitive data. Placeholder values (e.g., ***) are used where applicable.
| Positive |
TC-009 | Ensure that CLI commands trigger the correct API calls and logs reflect the endpoint usage. | - Ensure CLI is authenticated.
Execute a CLI command (e.g., airflow dags list). Access the API logs to identify the endpoint called. Verify that the logged API call matches the expected behaviour for the CLI command.
| The API logs show the correct endpoint is triggered. | Positive |