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

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

Issue 6551020: Merge remote branch 'autotest-upstream/master' into try-box1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/autotest.git@master
Patch Set: patch Created 9 years, 10 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/lmbench/0003-makefile.patch ('k') | client/tests/rmaptest/rmaptest.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, 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
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 cmd = 'taskset %s %s' % (cpu_affinity, cmd) 166 cmd = 'taskset %s %s' % (cpu_affinity, cmd)
167 167
168 try: 168 try:
169 cmds = [] 169 cmds = []
170 170
171 # Get 5 mpstat samples. Since tests with large number of streams 171 # Get 5 mpstat samples. Since tests with large number of streams
172 # take a long time to start up all the streams, we'll toss out the 172 # take a long time to start up all the streams, we'll toss out the
173 # first and last sample when recording results 173 # first and last sample when recording results
174 interval = max(1, test_time / 5) 174 interval = max(1, test_time / 5)
175 cmds.append('sleep %d && %s -P ALL %s 5' % (self.wait_time, mpstat, 175 cmds.append('sleep %d && %s -P ALL %s 5' % (self.wait_time, mpstat,
176 interval)) 176 interval))
177 177
178 # Add the netperf commands 178 # Add the netperf commands
179 for i in xrange(num_streams): 179 for i in xrange(num_streams):
180 cmds.append(cmd) 180 cmds.append(cmd)
181 if self.bidi and test == 'TCP_STREAM': 181 if self.bidi and test == 'TCP_STREAM':
182 cmds.append(cmd.replace('TCP_STREAM', 'TCP_MAERTS')) 182 cmds.append(cmd.replace('TCP_STREAM', 'TCP_MAERTS'))
183 183
184 t0 = time.time() 184 t0 = time.time()
185 # Launch all commands in parallel 185 # Launch all commands in parallel
186 out = utils.run_parallel(cmds, timeout=test_time + 500, 186 out = utils.run_parallel(cmds, timeout=test_time + 500,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « client/tests/lmbench/0003-makefile.patch ('k') | client/tests/rmaptest/rmaptest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698