Added timeout in iperf command for Vm2Vm test
Added timeout in iperf command for Vm2Vm test for having some
statistics: sometimes 10s timeout is not enough when the network
speed is unstable.
Change-Id: I4912ccf8ba346a8b427cf6bd6181ce6e6c180fb2
diff --git a/test_set/cvp-spt/tests/test_vm2vm.py b/test_set/cvp-spt/tests/test_vm2vm.py
index 7b3851b..4c2ec98 100644
--- a/test_set/cvp-spt/tests/test_vm2vm.py
+++ b/test_set/cvp-spt/tests/test_vm2vm.py
@@ -71,19 +71,19 @@
transport1 = ssh.SSHTransport(vm_info[0]['fip'], 'ubuntu', password='dd', private_key=os_resources['keypair'].private_key)
- result1 = transport1.exec_command('iperf -c {} | tail -n 1'.format(vm_info[1]['private_address']))
+ result1 = transport1.exec_command('iperf -c {} -t 60 | tail -n 1'.format(vm_info[1]['private_address']))
print ' '.join(result1.split()[-2::])
record_property("same {0}-{1}".format(zone1[0],zone2[0]), ' '.join(result1.split()[-2::]))
- result2 = transport1.exec_command('iperf -c {} | tail -n 1'.format(vm_info[2]['private_address']))
+ result2 = transport1.exec_command('iperf -c {} -t 60 | tail -n 1'.format(vm_info[2]['private_address']))
print ' '.join(result2.split()[-2::])
record_property("diff host {0}-{1}".format(zone1[0],zone2[0]), ' '.join(result2.split()[-2::]))
- result3 = transport1.exec_command('iperf -c {} -P 10 | tail -n 1'.format(vm_info[2]['private_address']))
+ result3 = transport1.exec_command('iperf -c {} -P 10 -t 60 | tail -n 1'.format(vm_info[2]['private_address']))
print ' '.join(result3.split()[-2::])
record_property("dif host 10 threads {0}-{1}".format(zone1[0],zone2[0]), ' '.join(result3.split()[-2::]))
- result4 = transport1.exec_command('iperf -c {} | tail -n 1'.format(vm_info[2]['fip']))
+ result4 = transport1.exec_command('iperf -c {} -t 60 | tail -n 1'.format(vm_info[2]['fip']))
print ' '.join(result4.split()[-2::])
record_property("diff host fip {0}-{1}".format(zone1[0],zone2[0]), ' '.join(result4.split()[-2::]))
- result5 = transport1.exec_command('iperf -c {} | tail -n 1'.format(vm_info[3]['private_address']))
+ result5 = transport1.exec_command('iperf -c {} -t 60 | tail -n 1'.format(vm_info[3]['private_address']))
print ' '.join(result5.split()[-2::])
record_property("diff host, diff net {0}-{1}".format(zone1[0],zone2[0]), ' '.join(result5.split()[-2::]))