Added ability to choose the version of iperf to test for multi-threading
The QA engineer can choose now the utility (version) of the iperf tool
to verify the multiple threads test cases.
Set 'iperf' to use 'iperf' tool (v2).
Set 'iperf3' to use iperf v3 tool.
Change-Id: Ie11fb6d148779b53183f362b27847e9880af3542
diff --git a/tests/test_vm2vm.py b/tests/test_vm2vm.py
index 9c6d107..1b81268 100644
--- a/tests/test_vm2vm.py
+++ b/tests/test_vm2vm.py
@@ -35,6 +35,8 @@
private_key = os_resources['keypair'].private_key
ssh_timeout = int(config.get('ssh_timeout', 500))
threads = int(config.get('multiple_threads_number', 10))
+ iperf_utility = config.get('multiple_threads_iperf_utility', 'iperf3')
+ utils.check_iperf_utility(iperf_utility)
result_table = Texttable(max_width=120)
try:
@@ -142,13 +144,22 @@
logger.info("Doing 'VM to VM in same tenant on different HW nodes "
"via Private IP, {} threads' measurement..."
"".format(threads))
- result3 = transport1.exec_command(
- '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')
+ if iperf_utility == "iperf3":
+ result3 = transport1.exec_command(
+ '{} -c {} -P {} -t {} | grep sender | tail -n 1'
+ ''.format(iperf_utility, vm_info[2]['private_address'],
+ threads, iperf_time))
+ res3 = (b" ".join(result3.split()[-4:-2:])).decode('utf-8')
+ else:
+ iperf_utility = "iperf"
+ result3 = transport1.exec_command(
+ '{} -c {} -P {} -t {} | tail -n 1'.format(iperf_utility,
+ 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, {} threads; iperf (v2)'.format(threads),
+ 'via Private IP, {} threads; {}'
+ ''.format(threads, iperf_utility),
"{}".format(pair[0]),
"{}".format(pair[1]),
"{}, {}".format(mtus[0], mtus[2]),