|
| 1 | +# Mandatory IaaS Service APIs Test Suite |
| 2 | + |
| 3 | +## Test Environment Setup |
| 4 | + |
| 5 | +### Test Execution Environment |
| 6 | + |
| 7 | +> **NOTE:** The test execution procedure does not require cloud admin rights. |
| 8 | +
|
| 9 | +To execute the test suite a valid cloud configuration for the OpenStack SDK in the shape of "`clouds.yaml`" is mandatory[^1]. |
| 10 | +**The file is expected to be located in the current working directory where the test script is executed unless configured otherwise.** |
| 11 | + |
| 12 | +[^1]: [OpenStack Documentation: Configuring OpenStack SDK Applications](https://docs.openstack.org/openstacksdk/latest/user/config/configuration.html) |
| 13 | + |
| 14 | +The test execution environment can be located on any system outside of the cloud infrastructure that has OpenStack API access. |
| 15 | +Make sure that the API access is configured properly in "`clouds.yaml`". |
| 16 | + |
| 17 | +It is recommended to use a Python virtual environment[^2]. |
| 18 | +Next, install the OpenStack SDK and boto3 required by the test suite: |
| 19 | + |
| 20 | +```bash |
| 21 | +pip3 install openstacksdk |
| 22 | +pip3 install boto3 |
| 23 | +``` |
| 24 | + |
| 25 | +Within this environment execute the test suite. |
| 26 | + |
| 27 | +[^2]: [Python 3 Documentation: Virtual Environments and Packages](https://docs.python.org/3/tutorial/venv.html) |
| 28 | + |
| 29 | +## Test Execution |
| 30 | + |
| 31 | +The test suite is executed as follows: |
| 32 | + |
| 33 | +```bash |
| 34 | +python3 mandatory-iaas-services.py --os-cloud mycloud |
| 35 | +``` |
| 36 | + |
| 37 | +As an alternative to "`--os-cloud`", the "`OS_CLOUD`" environment variable may be specified instead. |
| 38 | +The parameter is used to look up the correct cloud configuration in "`clouds.yaml`". |
| 39 | +For the example command above, this file should contain a `clouds.mycloud` section like this: |
| 40 | + |
| 41 | +```yaml |
| 42 | +--- |
| 43 | +clouds: |
| 44 | + mycloud: |
| 45 | + auth: |
| 46 | + auth_url: ... |
| 47 | + ... |
| 48 | + ... |
| 49 | +``` |
| 50 | + |
| 51 | +If the deployment uses s3 only and does not have the object store endpoint specified in the service catalog, the "`--s3-endpoint`" flag may be used to specify the s3 endpoint. |
| 52 | +In that case the "`--s3-access`" and "`--s3-access-secret`" flags must also be set, to give all necessery credentials to the test suite: |
| 53 | + |
| 54 | +```bash |
| 55 | +python3 mandatory-iaas-services3.py --os-cloud mycloud2 --s3-endpoint "http://s3-endpoint:9000" --s3-access test-user --s3-access-secret test-user-secret |
| 56 | +``` |
| 57 | + |
| 58 | +For any further options consult the output of "`python3 volume-backup-tester.py --help`". |
| 59 | + |
| 60 | +### Script Behavior & Test Results |
| 61 | + |
| 62 | +If all tests pass, the script will return with an exit code of `0`. |
| 63 | + |
| 64 | +If any test fails, the script will halt, print the exact error to `stderr` and return with a non-zero exit code. |
| 65 | + |
| 66 | +There is no cleanup done by this test as it mainly only inspect the service catalog and only for the object store creates a bucket, which is then promptly deleted. |
0 commit comments