Changed the default path for the offline iperf packages

The default path to the offline iperf3 package and its dependencies
is set to /opt/packages now due to the new approach with the offline
toolset image where these packages are already present.

With new iperf3 version at /opt/packages, we need more dependencies,
so the search for the offline packages is changed.

Change-Id: If2dbe537a25905ec7260a5133e1956f60ae2c73e
3 files changed
tree: a5080a16cd44e34b9a20aa394b498bf29032d40b
  1. fixtures/
  2. tests/
  3. utils/
  4. .gitignore
  5. .gitreview
  6. __init__.py
  7. conftest.py
  8. global_config.yaml
  9. pytest.ini
  10. README.md
  11. requirements.txt
README.md

mos-spt

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.

  • test_glance allows next overrides:
Environment VariableDefaultDescription
IMAGE_SIZE_MB9000Specific image size (in MB) to upload/download at Glance
  • test_vm2vm allows next overrides:
Environment VariableDefaultDescription
flavor_namespt-testFlavor name
flavor_ram1536To define RAM allocation for specific flavor, MB
flavor_vcpus1To define a count of vCPU for flavor
flavor_disk5To define a count of disks on flavor, GB
image_nameUbuntu-18.04Cloud 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_timeout300Timeout to VM to be ACTIVE, seconds.
external_networkpublicExternal network name to allocate the Floating IPs
ssh_timeout500Timeout 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/opt/packages/Path to the local directory where the iperf3 *.deb packages are present. In the toolset offline images they are located at /opt/packages. Or you can download iperf3 deb package and its dependencies and put them at some custom folder.
iperf_time60iperf3 -t option value: time in seconds to transmit for (iperf -t option).

In case internet_at_vms=false, please make sure that iperf_deb_package_dir_path is set correctly and has iperf3 deb package and its dependencies.

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 -o log_cli=true option to see detailed logs:

pytest -sv --tb=short -o log_cli=true 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 in pytest.ini file.