OLD | NEW |
1 import os, re, socket, time, logging | 1 import os, re, socket, time, logging |
2 from autotest_lib.client.bin import test, utils | 2 from autotest_lib.client.bin import test, utils |
3 from autotest_lib.client.bin.net import net_utils | 3 from autotest_lib.client.bin.net import net_utils |
4 from autotest_lib.client.common_lib import error | 4 from autotest_lib.client.common_lib import error |
5 | 5 |
6 MPSTAT_IX = 0 | 6 MPSTAT_IX = 0 |
7 IPERF_IX = 1 | 7 IPERF_IX = 1 |
8 | 8 |
9 class iperf(test.test): | 9 class iperf(test.test): |
10 version = 2 | 10 version = 2 |
11 | 11 |
12 # http://downloads.sourceforge.net/iperf/iperf-2.0.4.tar.gz | 12 # http://downloads.sourceforge.net/iperf/iperf-2.0.4.tar.gz |
13 def setup(self, tarball = 'iperf-2.0.4.tar.gz'): | 13 def setup(self, tarball = 'iperf-2.0.4.tar.gz'): |
14 self.job.require_gcc() | 14 self.job.require_gcc() |
15 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 15 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
16 utils.extract_tarball_to_dir(tarball, self.srcdir) | 16 utils.extract_tarball_to_dir(tarball, self.srcdir) |
17 | 17 |
18 self.job.setup_dep(['sysstat']) | 18 self.job.setup_dep(['sysstat']) |
19 | 19 |
20 os.chdir(self.srcdir) | 20 os.chdir(self.srcdir) |
21 utils.configure() | 21 utils.configure() |
22 utils.system('make') | 22 utils.make() |
23 utils.system('sync') | 23 utils.system('sync') |
24 | 24 |
25 | 25 |
26 def initialize(self): | 26 def initialize(self): |
27 self.SERVER_PORT = '5001' | 27 self.SERVER_PORT = '5001' |
28 | 28 |
29 # The %%s is to add extra args later | 29 # The %%s is to add extra args later |
30 # We cannot use daemon mode because it is unreliable with | 30 # We cannot use daemon mode because it is unreliable with |
31 # UDP transfers. | 31 # UDP transfers. |
32 self.server_path = "%s %%s&" % os.path.join(self.srcdir, | 32 self.server_path = "%s %%s&" % os.path.join(self.srcdir, |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 | 275 |
276 if keyval['CPU_C']: | 276 if keyval['CPU_C']: |
277 keyval['Efficiency_C'] = total_bw/keyval['CPU_C'] | 277 keyval['Efficiency_C'] = total_bw/keyval['CPU_C'] |
278 else: | 278 else: |
279 keyval['Efficiency_C'] = total_bw | 279 keyval['Efficiency_C'] = total_bw |
280 self.write_iteration_keyval(attr, keyval) | 280 self.write_iteration_keyval(attr, keyval) |
281 else: | 281 else: |
282 # This test currently does not produce a keyval file on the | 282 # This test currently does not produce a keyval file on the |
283 # server side. This should be implemented eventually. | 283 # server side. This should be implemented eventually. |
284 logging.info(self.results) | 284 logging.info(self.results) |
OLD | NEW |