• Home
  • Raw
  • Download

Lines Matching refs:subcommand

9 from autotest_lib.server import subcommand
14 class wrapper(subcommand.subcommand):
34 subcommand.subcommand.fork_hooks = []
35 subcommand.subcommand.join_hooks = []
54 cmd = subcommand.subcommand(func, (2, 3))
58 self.god.stub_function(subcommand.os.path, 'abspath')
59 self.god.stub_function(subcommand.os.path, 'exists')
60 self.god.stub_function(subcommand.os, 'mkdir')
62 subcommand.os.path.abspath.expect_call('dir').and_return('/foo/dir')
63 subcommand.os.path.exists.expect_call('/foo/dir').and_return(False)
64 subcommand.os.mkdir.expect_call('/foo/dir')
66 (subcommand.os.path.exists.expect_call('/foo/dir/debug')
68 subcommand.os.mkdir.expect_call('/foo/dir/debug')
70 cmd = subcommand.subcommand(func, (2, 3), subdir='dir')
77 self.god.stub_function(subcommand.os, 'fork')
79 subcommand.os.fork.expect_call().and_return(1000)
95 self.god.stub_function(subcommand.os, 'pipe')
96 self.god.stub_function(subcommand.os, 'fork')
97 self.god.stub_function(subcommand.os, 'close')
98 self.god.stub_function(subcommand.os, 'write')
99 self.god.stub_function(subcommand.cPickle, 'dumps')
100 self.god.stub_function(subcommand.os, '_exit')
110 subcommand.subcommand.register_fork_hook(fork_hook)
111 subcommand.subcommand.register_join_hook(join_hook)
114 subcommand.os.pipe.expect_call().and_return((10, 20))
115 subcommand.os.fork.expect_call().and_return(0)
116 subcommand.os.close.expect_call(10)
119 subcommand.cPickle.dumps.expect_call(True,
120 subcommand.cPickle.HIGHEST_PROTOCOL).and_return('True')
121 subcommand.os.write.expect_call(20, 'True')
122 subcommand.os.close.expect_call(20)
124 subcommand.os._exit.expect_call(0)
132 self.god.stub_function(subcommand.logging, 'exception')
138 subcommand.os.pipe.expect_call().and_return((10, 20))
139 subcommand.os.fork.expect_call().and_return(0)
140 subcommand.os.close.expect_call(10)
142 subcommand.logging.exception.expect_call('function failed')
143 subcommand.cPickle.dumps.expect_call(error,
144 subcommand.cPickle.HIGHEST_PROTOCOL).and_return('error')
145 subcommand.os.write.expect_call(20, 'error')
146 subcommand.os.close.expect_call(20)
147 subcommand.os._exit.expect_call(1)
155 self.god.stub_function(subcommand.os, 'waitpid')
162 (subcommand.os.waitpid.expect_call(1000, subcommand.os.WNOHANG)
163 .and_raises(subcommand.os.error('waitpid')))
171 (subcommand.os.waitpid.expect_call(1000, subcommand.os.WNOHANG)
181 (subcommand.os.waitpid.expect_call(1000, subcommand.os.WNOHANG)
192 (subcommand.os.waitpid.expect_call(1000, 0)
203 (subcommand.os.waitpid.expect_call(1000, 0)
216 cmd = subcommand.subcommand(func, args)
250 self.god.stub_function(subcommand.cPickle, 'load')
282 (subcommand.cPickle.load.expect_call(task.result_pickle)
286 subcommand.parallel(tasklist)
295 (subcommand.cPickle.load.expect_call(task.result_pickle)
299 self.assertRaises(subcommand.error.AutoservError, subcommand.parallel,
305 self.god.stub_function(subcommand.time, 'time')
310 subcommand.time.time.expect_call().and_return(1)
313 subcommand.time.time.expect_call().and_return(1)
315 (subcommand.cPickle.load.expect_call(task.result_pickle)
319 self.assertRaises(subcommand.error.AutoservError, subcommand.parallel,
328 (subcommand.cPickle.load.expect_call(tasklist[0].result_pickle)
334 (subcommand.cPickle.load.expect_call(tasklist[1].result_pickle)
338 self.assertEquals(subcommand.parallel(tasklist, return_results=True),
346 self.god.stub_function(subcommand, 'parallel')
348 self.god.stub_with(subcommand, 'subcommand', ctor)
360 subcommand.parallel_simple(func, (3,))
370 self.assertRaises(Exception, subcommand.parallel_simple, func, (3,))
380 self.assertEquals(subcommand.parallel_simple(func, (3,),
390 subcommand.subcommand.expect_call(
392 subcommand.parallel.expect_call(args, None, return_results=False)
394 subcommand.parallel_simple(func, args)
402 subcommand.subcommand.expect_call(
404 subcommand.parallel.expect_call(args, None, return_results=False)
406 subcommand.parallel_simple(func, args, log=False)
415 subcommand.subcommand.expect_call(
417 subcommand.parallel.expect_call(args, None, return_results=False)
419 subcommand.parallel_simple(