Switched multi-threads testing from iperf3 to iperf
Switched multi-threads testing from iperf3 to iperf because the
iperf3 was not designed for the multiple threads, see [1] and [2].
So, iperf (v2) will be used for measuring tests with -P option.
Made the number of threads as an configurable option (10 by default).
* installing iperf package
* allowing 5001 port
* starting iperf as well as iperf3 at VMs
* added 'multiple_threads_number' option (10 by default)
* added details which tool was used (iperf3 or iperf) in the final table
* changed the default image from Ubuntu18 to Ubuntu20
[1] https: //fasterdata.es.net/performance-testing/network-troubleshooting-tools/iperf/multi-stream-iperf3/
[2] https: //github.com/esnet/iperf/issues/289
Related-PROD: PROD-36943
Change-Id: I39d2c44723344c87836bf7b5fa02b546a08f2ca5
diff --git a/utils/ssh.py b/utils/ssh.py
index f6d61a2..fb684bb 100644
--- a/utils/ssh.py
+++ b/utils/ssh.py
@@ -126,14 +126,14 @@
def put_iperf3_deb_packages_at_vms(self, source_directory,
destination_directory):
- required_packages = ['iperf3', 'libiperf0', 'libsctp1']
+ required_packages = ['iperf', '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 {}. "
- "Please recheck 'iperf_deb_package_dir_path' variable in "
+ "iperf3 or iperf *.deb packages are not found locally at path"
+ " {}. Please recheck 'iperf_deb_package_dir_path' variable in "
"global_config.yaml and check *.deb packages are manually "
"copied there.".format(source_directory))
for f in iperf_deb_files:
@@ -186,6 +186,7 @@
mtu = transport.exec_command('cat /sys/class/net/{}/mtu'.format(iface))
return mtu.decode("utf-8")
+
class prepare_iperf(object):
def __init__(self, fip, user='ubuntu', password='password',
@@ -194,10 +195,10 @@
transport = SSHTransport(fip, user, password, private_key)
config = utils.get_configuration()
- # Install iperf3 using apt or downloaded deb package
+ # Install iperf, iperf3 using apt or downloaded deb packages
internet_at_vms = utils.get_configuration().get("internet_at_vms")
if internet_at_vms.lower() == 'false':
- logger.info("Copying offline iperf3 deb packages, installing...")
+ logger.info("Copying offline iperf* deb packages, installing...")
path_to_iperf_deb = (config.get('iperf_deb_package_dir_path') or
"/opt/packages/")
home_ubuntu = "/home/ubuntu/"
@@ -205,15 +206,16 @@
home_ubuntu)
transport.exec_command('sudo dpkg -i {}*.deb'.format(home_ubuntu))
else:
- logger.info("Installing iperf3 using apt")
+ logger.info("Installing iperf, iperf3 using apt")
preparation_cmd = config.get('iperf_prep_string') or ['']
transport.exec_command(preparation_cmd)
transport.exec_command('sudo apt-get update;'
- 'sudo apt-get install -y iperf3')
+ 'sudo apt-get install -y iperf3 iperf')
# Log whether iperf is installed with version
- check = transport.exec_command('dpkg -l | grep iperf3')
- logger.debug(check.decode('utf-8'))
+ check = transport.exec_command('dpkg -l | grep iperf')
+ logger.info(check.decode('utf-8'))
# Staring iperf server
transport.exec_command('nohup iperf3 -s > file 2>&1 &')
+ transport.exec_command('nohup iperf -s > file 2>&1 &')