commit | 8402302d14b2471208162b74a2d2364eee5e4576 | [log] [tgz] |
---|---|---|
author | Ievgeniia Zadorozhna <izadorozhna@mirantis.com> | Thu Dec 30 13:00:41 2021 +0200 |
committer | Ievgeniia Zadorozhna <izadorozhna@mirantis.com> | Mon Jan 10 16:05:42 2022 +0300 |
tree | 312e74f5a24542c7fd01ecb5fa9c30e4c691a705 | |
parent | bc153f583d0fc9cba63cb11f9a177c97fa4ea689 [diff] |
Reworked SPT tests for running at MOS inside rally pod These SPT tests are taken from the CVP-SPT, but reworked to test MOS inside rally pod. Here is the list of changes since CVP-SPT: * Switched to Python3 * Removed all Salt related code * Removed HW2HW test * Default global_config.yaml is suitable for MOS * Switched to iperf3 * Added smart waiters for VMs to be Active, VMs to be reachable by FIPs * Extended pytest.ini file with logging settings * Added lots of loggers at info level to understand what happends during the test run * Extended & fixed README with the actual instruction * Ability to use iperf3 even if there is no Internet at VMs * Fixed the coding style according PEP8 * Various small fixes, enhancements Change-Id: I31a1b8c8c827133d144377031c6f546d8c82a47d
Requirements
At least Python 3.6 is required for the tests.
Installation
cd mos-spt/ virtualenv .venv . .venv/bin/activate pip install -r requirements.txt
Configuration
Open global_config.yaml file to override the settings, or export the environment variables.
Settings
The following options can be set in global_config.yaml file, or by exporting the environment variables.
Environment Variable | Default | Description |
---|---|---|
IMAGE_SIZE_MB | 9000 | Specific image size (in MB) to upload/download at Glance |
Environment Variable | Default | Description |
---|---|---|
flavor_name | spt-test | Flavor name |
flavor_ram | 1536 | To define RAM allocation for specific flavor, MB |
flavor_vcpus | 1 | To define a count of vCPU for flavor |
flavor_disk | 5 | To define a count of disks on flavor, GB |
image_name | Ubuntu-18.04 | Cloud Ubuntu image to create VMs |
CMP_HOSTS | "" | Pair of compute hosts to create VMs at different hosts. By default, some random pair from nova compute list will be selected. To set some pair, set CMP_HOSTS: ["cmp001", "cmp002"] in global_config.yaml file, or export CMP_HOSTS="cmp001,cmp002". |
skipped_nodes | "" | Skip some compute hosts, so they are not selected at CMP_HOSTS pair. To set some nodes to skip, set skipped_nodes: ["cmp003"] in global_config.yaml file, or export skipped_nodes="cmp003". |
nova_timeout | 300 | Timeout to VM to be ACTIVE, seconds. |
external_network | public | External network name to allocate the Floating IPs |
ssh_timeout | 500 | Timeout to VM to be reachable via SSH, seconds. |
iperf_prep_string | "sudo /bin/bash -c 'echo "91.189.88.161 archive.ubuntu.com" >> /etc/hosts'" | Preparation string to set ubuntu repository host in /etc/hosts of VMs |
internet_at_vms | 'true' | In case True, the Internet is present at VMs, and the tests are able to install iperf3 by apt update; apt install iperf3. In case VMs have no Internet, set 'false' and the iperf3 will be installed from offline *.deb packages. |
iperf_deb_package_dir_path | /artifacts/mos-spt/ | Path to the local directory where the iperf3 *.deb packages are present. You need to download/copy them there manually beforehand. |
iperf_time | 60 | iperf3 -t option value: time in seconds to transmit for (iperf -t option). |
In case internet_at_vms=false, download the iperf3 packages from:
wget https://iperf.fr/download/ubuntu/libiperf0_3.1.3-1_amd64.deb wget https://iperf.fr/download/ubuntu/iperf3_3.1.3-1_amd64.deb
and place both of them to the path equal to iperf_deb_package_dir_path.
Executing tests
Run tests:
pytest -sv --tb=short tests/
In case the test is skipped and you want to know the reason, use python -rs option:
pytest -rs --tb=short tests/
Enable logging
In case something went wrong, use logging of the tests, set “log_cli=true” in pytest.ini and rerun tests. By default, the log level is INFO log_cli_level=info. In case you want to go deeper for the API requests (with URIs, payloads, etc), set cli_level=debug.