Ejemplo n.º 1
0
 def get_command(self):
     cmd = base.CommandLine('iperf')
     add_common_iperf_params(cmd, self)
     cmd.add('--nodelay')
     if self.test_definition.get('csv'):
         cmd.add('--reportstyle', 'C')
     return cmd.make()
Ejemplo n.º 2
0
 def get_command(self):
     cmd = base.CommandLine('netperf')
     cmd.add('-H', self.test_definition.get('host') or
             self.agent['slave']['ip'])
     cmd.add('-l', self.get_expected_duration())
     cmd.add('-t', self.test_definition.get('method') or 'TCP_STREAM')
     return cmd.make()
Ejemplo n.º 3
0
 def get_command(self):
     cmd = base.CommandLine('netperf-wrapper')
     cmd.add('-H', self.agent['slave']['ip'])
     cmd.add('-l', self.get_expected_duration())
     cmd.add('-s', self.test_definition.get('interval') or 1)
     cmd.add('-f', 'csv')
     cmd.add(self.test_definition.get('method') or 'tcp_download')
     return cmd.make()
Ejemplo n.º 4
0
    def get_command(self):
        if not self.test_definition.get('interval'):
            self.test_definition['interval'] = 1

        cmd = base.CommandLine('iperf3')
        add_common_iperf_params(cmd, self)
        cmd.add('--json')
        return cmd.make()
Ejemplo n.º 5
0
 def get_command(self):
     cmd = base.CommandLine('flent')
     cmd.add('-H', self.agent['slave']['ip'])
     cmd.add('-l', self.test_definition.get('time') or 60)
     cmd.add('-s', self.test_definition.get('interval') or 1)
     cmd.add(self.test_definition.get('method') or 'tcp_download')
     flent_cmd = cmd.make()
     return base.Script(FLENT_EXEC % flent_cmd['data']).make()
Ejemplo n.º 6
0
    def test_add_common_iperf_params(self):
        executor = iperf.IperfExecutor({
            'bandwidth': '100M',
            'time': 30
        }, AGENT)

        cmd = base.CommandLine('iperf')
        iperf.add_common_iperf_params(cmd, executor)

        expected = {
            'data': ('iperf --client %s --format m --bandwidth 100M'
                     ' --time 30 --parallel 1 --nodelay') % IP,
            'type':
            'program'
        }

        self.assertEqual(expected, executor.get_command())
Ejemplo n.º 7
0
 def get_command(self):
     cmd = base.CommandLine('sudo nice -n -20 iperf')
     cmd.add('--client', self.agent['slave']['ip'])
     cmd.add('--format', 'm')
     cmd.add('--nodelay')
     if self.test_definition.get('mss'):
         cmd.add('--mss', self.test_definition.get('mss'))
     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.get_expected_duration())
     cmd.add('--parallel', self.test_definition.get('threads') or 1)
     if self.test_definition.get('csv'):
         cmd.add('--reportstyle', 'C')
     if self.test_definition.get('interval'):
         cmd.add('--interval', self.test_definition.get('interval'))
     return cmd.make()
Ejemplo n.º 8
0
    def test_add_common_iperf_params_args_with_exclusion(self):
        executor = iperf.IperfExecutor(
            # add time on purpose to make sure it is excluded
            {
                'bandwidth': '100M',
                'time': 30,
                'args': '--blockcount 1M --zerocopy --omit 1',
            },
            AGENT)

        cmd = base.CommandLine('iperf')
        iperf.add_common_iperf_params(cmd, executor)

        # time should not be present since it is mutually exclusive with
        # -k/blockcount
        expected = {
            'data': ('iperf --client %s --format m --bandwidth 100M'
                     ' --blockcount 1M --zerocopy --omit 1 '
                     '--parallel 1 --nodelay') % IP,
            'type':
            'program'
        }

        self.assertEqual(expected, executor.get_command())
Ejemplo n.º 9
0
 def get_command(self):
     if 'program' in self.test_definition:
         cmd = base.CommandLine(self.test_definition['program'])
     elif 'script' in self.test_definition:
         cmd = base.Script(self.test_definition['script'])
     return cmd.make()