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 network_netperf2(test.test): | 9 class network_netperf2(test.test): |
10 version = 1 | 10 version = 1 |
11 | 11 |
12 # ftp://ftp.netperf.org/netperf/netperf-2.4.4.tar.gz | 12 # ftp://ftp.netperf.org/netperf/netperf-2.4.4.tar.gz |
13 def setup(self, tarball = 'netperf-2.4.4.tar.gz'): | 13 def setup(self, tarball = 'netperf-2.4.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 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 # Fixing up a compile issue under newer systems that have | 20 # Fixing up a compile issue under newer systems that have |
21 # CPU_SET_S defined on /usr/include/sched.h, backported from | 21 # CPU_SET_S defined on /usr/include/sched.h, backported from |
22 # upstream svn trunk | 22 # upstream svn trunk |
23 utils.system('patch -p0 < ../fix_netperf_build.patch') | 23 utils.system('patch -p0 < ../fix_netperf_build.patch') |
24 utils.configure() | 24 utils.configure() |
25 utils.system('make') | 25 utils.make() |
26 utils.system('sync') | 26 utils.system('sync') |
27 | 27 |
28 self.job.setup_dep(['sysstat']) | 28 self.job.setup_dep(['sysstat']) |
29 | 29 |
30 | 30 |
31 def initialize(self): | 31 def initialize(self): |
32 self.client_prog = '%s' % os.path.join(self.srcdir, 'src/netperf') | 32 self.client_prog = '%s' % os.path.join(self.srcdir, 'src/netperf') |
33 self.valid_tests = ['TCP_STREAM', 'TCP_MAERTS', 'TCP_RR', 'TCP_CRR', | 33 self.valid_tests = ['TCP_STREAM', 'TCP_MAERTS', 'TCP_RR', 'TCP_CRR', |
34 'TCP_SENDFILE', 'UDP_STREAM', 'UDP_RR'] | 34 'TCP_SENDFILE', 'UDP_STREAM', 'UDP_RR'] |
35 self.results = [] | 35 self.results = [] |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 end_time = curr_time + timeout | 298 end_time = curr_time + timeout |
299 while curr_time < end_time: | 299 while curr_time < end_time: |
300 if not os.system('ping -c 1 ' + ip): | 300 if not os.system('ping -c 1 ' + ip): |
301 # Ping succeeded | 301 # Ping succeeded |
302 return | 302 return |
303 # Ping failed. Lets sleep a bit and try again. | 303 # Ping failed. Lets sleep a bit and try again. |
304 time.sleep(5) | 304 time.sleep(5) |
305 curr_time = time.time() | 305 curr_time = time.time() |
306 | 306 |
307 return | 307 return |
OLD | NEW |