$python Python 2.7.3 (default, Jun 15 2012, 15:26:07) [GCC 4.7.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from autotest.client import utils, test >>> x = utils.AsyncJob("sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 && echo hi && sleep 1") DEBUG:root:Running 'sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 && echo hi && sleep 1' >>> x.wait_for() * Command: sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 Exit status: 0 Duration: 28.2366471291 stdout: hi hi hi >>> y = utils.AsyncJob("sleep 100") DEBUG:root:Running 'sleep 100' >>> y.wait_for() * Command: sleep 100 Exit status: 0 Duration: 100.024924994 >>> x.wait_for() * Command: sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 && echo hi && sleep 1 Exit status: 0 Duration: 441.024215937 stdout: hi hi hi >>> y.wait_for() * Command: sleep 100 Exit status: 0 Duration: 121.19008112 >>> print "Process 2 took %d to be killed" % (time.time()-t) Traceback (most recent call last): File "", line 1, in NameError: name 'time' is not defined >>> y = utils.AsyncJob("sleep 100") DEBUG:root:Running 'sleep 100' >>> print "Process 2 took %d to be killed" % (time.time()-t) Traceback (most recent call last): File "", line 1, in NameError: name 'time' is not defined >>> y.wait_for() * Command: sleep 100 Exit status: 0 Duration: 100.026224852 >>>