Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: client/tests/netpipe/netpipe.py

Issue 3554003: Merge remote branch 'cros/upstream' into tempbranch3 (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « client/tests/netperf2/netperf2.py ('k') | client/tests/perfmon/perfmon.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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)
OLDNEW
« no previous file with comments | « client/tests/netperf2/netperf2.py ('k') | client/tests/perfmon/perfmon.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698