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/tests/test_vm2vm.py b/tests/test_vm2vm.py
index 4367ee8..9c6d107 100644
--- a/tests/test_vm2vm.py
+++ b/tests/test_vm2vm.py
@@ -21,7 +21,8 @@
3. Connect to each VM via SSH and install iperf3
4. Measure VM to VM on same node via Private IP, 1 thread
5. Measure VM to VM on different HW nodes via Private IP, 1 thread
- 6. Measure VM to VM on different HW nodes via Private IP, 10 threads
+ 6. Measure VM to VM on different HW nodes via Private IP, multiple threads
+ (10 by default)
7. Measure VM to VM on different HW nodes via Floating IP, 1 thread
8. Measure VM to VM on different HW nodes, each VM is in separate network,
the networks are connected using Router via Private IP, 1 thread
@@ -33,7 +34,8 @@
iperf_time = int(config.get('iperf_time', 60))
private_key = os_resources['keypair'].private_key
ssh_timeout = int(config.get('ssh_timeout', 500))
- result_table = Texttable()
+ threads = int(config.get('multiple_threads_number', 10))
+ result_table = Texttable(max_width=120)
try:
zone1 = [service.zone for service in
@@ -115,7 +117,7 @@
res1 = (b" ".join(result1.split()[-4:-2:])).decode('utf-8')
logger.info("Result #1 is {}".format(res1))
table_rows.append(['VM to VM in same tenant on same node via '
- 'Private IP, 1 thread',
+ 'Private IP, 1 thread; iperf3',
"{}".format(pair[0]),
"{}".format(pair[0]),
"{}, {}".format(mtus[0], mtus[1]),
@@ -130,7 +132,7 @@
res2 = (b" ".join(result2.split()[-4:-2:])).decode('utf-8')
logger.info("Result #2 is {}".format(res2))
table_rows.append(['VM to VM in same tenant on different HW nodes '
- 'via Private IP, 1 thread',
+ 'via Private IP, 1 thread; iperf3',
"{}".format(pair[0]),
"{}".format(pair[1]),
"{}, {}".format(mtus[0], mtus[2]),
@@ -138,20 +140,21 @@
# Do iperf3 measurement #3
logger.info("Doing 'VM to VM in same tenant on different HW nodes "
- "via Private IP, 10 threads' measurement...")
+ "via Private IP, {} threads' measurement..."
+ "".format(threads))
result3 = transport1.exec_command(
- 'iperf3 -c {} -P 10 -t {} | grep sender | tail -n 1'.format(
- vm_info[2]['private_address'], iperf_time))
- res3 = (b" ".join(result3.split()[-4:-2:])).decode('utf-8')
+ 'iperf -c {} -P {} -t {} | tail -n 1'.format(
+ vm_info[2]['private_address'], threads, iperf_time))
+ res3 = (b" ".join(result3.split()[-2::])).decode('utf-8')
logger.info("Result #3 is {}".format(res3))
table_rows.append(['VM to VM in same tenant on different HW nodes '
- 'via Private IP, 10 threads',
+ 'via Private IP, {} threads; iperf (v2)'.format(threads),
"{}".format(pair[0]),
"{}".format(pair[1]),
"{}, {}".format(mtus[0], mtus[2]),
"{}".format(res3)])
- # Do iperf3 measurement #4
+ # Do iperf (v2) measurement #4
logger.info("Doing 'VM to VM in same tenant via Floating IP and VMs "
"are on different nodes, 1 thread' measurement...")
result4 = transport1.exec_command(
@@ -160,7 +163,7 @@
res4 = (b" ".join(result4.split()[-4:-2:])).decode('utf-8')
logger.info("Result #4 is {}".format(res4))
table_rows.append(['VM to VM in same tenant via Floating IP and VMs '
- 'are on different nodes, 1 thread',
+ 'are on different nodes, 1 thread; iperf3',
"{}".format(pair[0]),
"{}".format(pair[1]),
"{}, {}".format(mtus[0], mtus[2]),
@@ -178,7 +181,8 @@
logger.info("Result #5 is {}".format(res5))
table_rows.append(['VM to VM in same tenant, different HW nodes and '
'each VM is connected to separate network which are'
- ' connected using Router via Private IP, 1 thread',
+ ' connected using Router via Private IP, 1 thread; '
+ 'iperf3',
"{}".format(pair[0]),
"{}".format(pair[1]),
"{}, {}".format(mtus[0], mtus[3]),