OLD | NEW |
1 import os, time, logging | 1 import os, 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.common_lib import error | 3 from autotest_lib.client.common_lib import error |
4 | 4 |
5 | 5 |
6 class netpipe(test.test): | 6 class netpipe(test.test): |
7 version = 1 | 7 version = 1 |
8 NP_FILE = '/tmp/np.out' | 8 NP_FILE = '/tmp/np.out' |
9 | 9 |
10 # http://www.scl.ameslab.gov/netpipe/code/NetPIPE-3.7.1.tar.gz | 10 # http://www.scl.ameslab.gov/netpipe/code/NetPIPE-3.7.1.tar.gz |
11 def setup(self, tarball='NetPIPE-3.7.1.tar.gz'): | 11 def setup(self, tarball='NetPIPE-3.7.1.tar.gz'): |
12 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) | 12 tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir) |
13 utils.extract_tarball_to_dir(tarball, self.srcdir) | 13 utils.extract_tarball_to_dir(tarball, self.srcdir) |
14 os.chdir(self.srcdir) | 14 os.chdir(self.srcdir) |
15 utils.system('patch -p1 < ../makefile.patch') | 15 utils.system('patch -p1 < ../makefile.patch') |
16 utils.system('make') | 16 utils.make() |
17 | 17 |
18 | 18 |
19 def initialize(self): | 19 def initialize(self): |
20 self.job.require_gcc() | 20 self.job.require_gcc() |
21 | 21 |
22 # Add arguments later | 22 # Add arguments later |
23 self.server_path = '%s %%s' % os.path.join(self.srcdir, 'NPtcp') | 23 self.server_path = '%s %%s' % os.path.join(self.srcdir, 'NPtcp') |
24 # Add server_ip and arguments later | 24 # Add server_ip and arguments later |
25 base_path = os.path.join(self.srcdir, 'NPtcp -h') | 25 base_path = os.path.join(self.srcdir, 'NPtcp -h') |
26 self.client_path = '%s %%s -o %s %%s' % (base_path, self.NP_FILE) | 26 self.client_path = '%s %%s -o %s %%s' % (base_path, self.NP_FILE) |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 try: | 102 try: |
103 output = open(self.NP_FILE) | 103 output = open(self.NP_FILE) |
104 for line in output.readlines(): | 104 for line in output.readlines(): |
105 buff, bandwidth, latency = line.split() | 105 buff, bandwidth, latency = line.split() |
106 attr = {'buffer_size':buff} | 106 attr = {'buffer_size':buff} |
107 keyval = {'bandwidth':bandwidth, 'latency':latency} | 107 keyval = {'bandwidth':bandwidth, 'latency':latency} |
108 self.write_iteration_keyval(attr, keyval) | 108 self.write_iteration_keyval(attr, keyval) |
109 finally: | 109 finally: |
110 output.close() | 110 output.close() |
111 os.remove(self.NP_FILE) | 111 os.remove(self.NP_FILE) |
OLD | NEW |