# cqa-cloud-api-test This repository contains automated tests for validating the functionality and regression of APIs provided by Verda KKS region and LY Flava cloud, using OpenStack Tempest. > * API documentation: https://git.linecorp.com/pages/Cloud-QA/cqa-cloud-api-test/ For detailed information about configuring and using OpenStack Tempest, refer to the [official documentation](https://docs.openstack.org/tempest/latest/). ## Overview The cqa-cloud-api-test repository aims to provide a comprehensive set of tests for cloud APIs, leveraging the capabilities of OpenStack Tempest. The primary goal is to ensure the quality, compatibility, and stability of the cloud services offered by Verda KKS region and LY Flava cloud. ## Structure ![structure](https://git.linecorp.com/storage/user/8216/files/3e2d6d1b-bea8-4a27-a7cf-731aa9bc2876) ## Usage 1. Clone the repository: ```bash git clone https://git.linecorp.com/Cloud-QA/cqa-cloud-api-test.git ``` 2. Install the required dependencies: ```bash pip install -r requirements.txt ``` 3. Set environment variables to run tests for each cloud: `Verda` | Variable Name | Required | Default Value | Description | | ------------- | -------- | ------------- | -------------------------------------------- | | TEST_ENV | yes | | Target environment(available: `verda_stage_prod_kks`) | `Flava` | Variable Name | Required | Default Value | Description | | ------------- | -------- | ------------- | -------------------------------------------- | | TEST_ENV | yes | | Target environment(available: `flava_stage_dev_kks`) | | ENVIRONMENT | optional | stage | Target environment(available: `stage`,`dev`,`prod` ) | 4. Setup configuration: Open the `${TEST_ENV}.conf` file in the `config` directory and edit the configuration to match valid data in your environment. This includes Keystone endpoints, valid users and credentials, and reference data to be used for testing. e.g. ``` [auth] test_accounts_file = ./configs/accounts.yaml use_dynamic_credentials = False [identity] disable_ssl_certificate_validation=True auth_version = v3 uri_v3 = https://verda-stage-prod-keystone.linecorp-dev.com:5000/v3 ``` 6. Setup test accounts for `Verda`: We recommend using Pre-Provisioned Credentials(`use_dynamic_credentials = False`) for this test. Admin account information is required to use Dynamic Credentials, which may lead to unexpected results. ```bash configs/accounts.yaml - username: 'lp99081' project_name: 'vqa-api-test-kks-stgprod' password: 'changeme' # To specify which roles a user has, you can list them under the roles field - username: 'lp99082' project_name: 'vqa-api-test-kks-stgprod' password: 'changeme' roles: - 'admin' ``` You can also specify the `qa_admin` role in your account credentials. The `qa_admin` role is a customized role created for the Verda QA team to verify some operations that require an admin role. For example, getting a list of availability zones or getting hypervisor information. ```bash configs/accounts.yaml - username: 'qa_operator' project_name: 'vqa-api-test-kks-stgprod' password: 'changeme' roles: - 'qa_admin' ``` 7. Setup test accounts for `Flava` automatically Check if environment variables are set as step (3) `Flava`, if not default values will be used e.g. ```bash bash scripts/account_generator.sh ``` > This script generates access tokens and update an `accounts.yaml` file with the generated tokens. 8. Run the tests: e.g. ```bash API Test: python -m pytest tests/api/identity/test_tokens.py Scenario Test: python -m pytest tests/scenario/test_server_attach_ssd_nvme_volumes.py ```