OLD | NEW |
1 import os, time, re, logging | 1 import os, time, re, 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 NETPERF_IX = 1 | 7 NETPERF_IX = 1 |
8 | 8 |
9 class netperf2(test.test): | 9 class netperf2(test.test): |
10 version = 4 | 10 version = 4 |
11 | 11 |
12 # ftp://ftp.netperf.org/netperf/netperf-2.4.5.tar.bz2 | 12 # ftp://ftp.netperf.org/netperf/netperf-2.4.5.tar.bz2 |
13 def setup(self, tarball = 'netperf-2.4.5.tar.bz2'): | 13 def setup(self, tarball = 'netperf-2.4.5.tar.bz2'): |
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 os.chdir(self.srcdir) | 17 os.chdir(self.srcdir) |
18 | 18 |
19 utils.system('patch -p0 < ../wait_before_data.patch') | 19 utils.system('patch -p0 < ../wait_before_data.patch') |
20 utils.configure() | 20 utils.configure() |
21 utils.make() | 21 utils.system('make') |
22 utils.system('sync') | 22 utils.system('sync') |
23 | 23 |
24 self.job.setup_dep(['sysstat']) | 24 self.job.setup_dep(['sysstat']) |
25 | 25 |
26 | 26 |
27 def initialize(self): | 27 def initialize(self): |
28 self.server_prog = '%s&' % os.path.join(self.srcdir, 'src/netserver') | 28 self.server_prog = '%s&' % os.path.join(self.srcdir, 'src/netserver') |
29 self.client_prog = '%s' % os.path.join(self.srcdir, 'src/netperf') | 29 self.client_prog = '%s' % os.path.join(self.srcdir, 'src/netperf') |
30 self.valid_tests = ['TCP_STREAM', 'TCP_MAERTS', 'TCP_RR', 'TCP_CRR', | 30 self.valid_tests = ['TCP_STREAM', 'TCP_MAERTS', 'TCP_RR', 'TCP_CRR', |
31 'TCP_SENDFILE', 'UDP_STREAM', 'UDP_RR'] | 31 'TCP_SENDFILE', 'UDP_STREAM', 'UDP_RR'] |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 end_time = curr_time + timeout | 341 end_time = curr_time + timeout |
342 while curr_time < end_time: | 342 while curr_time < end_time: |
343 if not os.system('ping -c 1 ' + ip): | 343 if not os.system('ping -c 1 ' + ip): |
344 # Ping succeeded | 344 # Ping succeeded |
345 return | 345 return |
346 # Ping failed. Lets sleep a bit and try again. | 346 # Ping failed. Lets sleep a bit and try again. |
347 time.sleep(5) | 347 time.sleep(5) |
348 curr_time = time.time() | 348 curr_time = time.time() |
349 | 349 |
350 return | 350 return |
OLD | NEW |