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
diff --git a/README.md b/README.md
index 55d0f2b..45b2213 100644
--- a/README.md
+++ b/README.md
@@ -45,15 +45,10 @@
| 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_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_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_.
+ 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
--
@@ -68,7 +63,10 @@
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
+ 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_.
+ (with URIs, payloads, etc), set _cli_level=debug_ in _pytest.ini_ file.
diff --git a/global_config.yaml b/global_config.yaml
index b297350..f6213ca 100644
--- a/global_config.yaml
+++ b/global_config.yaml
@@ -13,7 +13,7 @@
external_network: 'public'
iperf_prep_string: "sudo /bin/bash -c 'echo \"91.189.88.161 archive.ubuntu.com\" >> /etc/hosts'"
internet_at_vms: 'true' # whether Internet is present at OpenStack VMs and iperf can be installed with apt
-iperf_deb_package_dir_path: '/artifacts/mos-spt/'
+iperf_deb_package_dir_path: '/opt/packages/'
iperf_time: 60 # time in seconds to transmit for (iperf -t option)
ssh_timeout: 500
skipped_nodes: []
diff --git a/utils/ssh.py b/utils/ssh.py
index 29a56f0..0d82c52 100644
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -126,8 +126,10 @@
def put_iperf3_deb_packages_at_vms(self, source_directory,
destination_directory):
- iperf_deb_files = [f for f in os.listdir(source_directory)
- if "deb" in f]
+ required_packages = ['iperf3', 'libiperf0', 'libsctp1']
+ iperf_deb_files = [pack for pack in os.listdir(source_directory) if
+ any(req in pack for req in required_packages) if
+ pack.endswith('.deb')]
if not iperf_deb_files:
raise BaseException(
"iperf3 *.deb packages are not found locally at path {}. "
@@ -190,7 +192,7 @@
if internet_at_vms.lower() == 'false':
logger.info("Copying offline iperf3 deb packages, installing...")
path_to_iperf_deb = (config.get('iperf_deb_package_dir_path') or
- "/artifacts/mos-spt/")
+ "/opt/packages/")
home_ubuntu = "/home/ubuntu/"
transport.put_iperf3_deb_packages_at_vms(path_to_iperf_deb,
home_ubuntu)