Add bandwidth support for iperf command

Change-Id: I341bb69d0c27dccb07642346b5dde91bf07ba34d
This commit is contained in:
Ilya Shakhat 2015-03-26 18:41:57 +03:00
parent 2a94c16348
commit affe2202b3
2 changed files with 5 additions and 2 deletions

View File

@ -29,6 +29,8 @@ class IperfExecutor(base.BaseExecutor):
cmd.add('--len', self.test_definition.get('buffer_size') or '8k')
if self.test_definition.get('udp'):
cmd.add('--udp')
if self.test_definition.get('bandwidth'):
cmd.add('--bandwidth', self.test_definition.get('bandwidth'))
cmd.add('--time', self.test_definition.get('time') or 60)
cmd.add('--parallel', self.test_definition.get('threads') or 1)
if self.test_definition.get('csv'):

View File

@ -35,10 +35,11 @@ class TestIperfGraphExecutor(testtools.TestCase):
def test_get_command_udp(self):
executor = iperf.IperfGraphExecutor(
{'udp': True, 'time': 30}, AGENT)
{'udp': True, 'bandwidth': '100M', 'time': 30}, AGENT)
expected = {'data': ('sudo nice -n -20 iperf --client %s --format m '
'--nodelay --len 8k --udp --time 30 --parallel 1 '
'--nodelay --len 8k --udp --bandwidth 100M '
'--time 30 --parallel 1 '
'--reportstyle C --interval 1') % IP,
'type': 'program'}
self.assertEqual(expected, executor.get_command())