blob: 46f9a7155093d692f836ed0262352f587da8436a [file] [log] [blame]
mbligh570e93e2006-11-26 05:15:56 +00001#!/usr/bin/python
mbligh0ccc1b02008-04-11 15:40:38 +00002import common
mblighfbfb77d2007-02-15 18:54:03 +00003
mblighe7693ba2009-01-30 00:49:59 +00004import sys, os, time, subprocess
mbligh570e93e2006-11-26 05:15:56 +00005
jadmanski8d6295d2008-05-29 21:43:35 +00006from autotest_lib.client.common_lib import utils
mbligh0ccc1b02008-04-11 15:40:38 +00007
mbligh570e93e2006-11-26 05:15:56 +00008# We want to set the output (stdout&stderr) of the autotest binary onto our
9# stdout channel. We went to get the status stream of autotest back on our
10# stderr channel - we set up fd 3 for this, and harness_simple.py can
11# open it later.
12
13# Set up file descriptor 3 as a copy of our stderr. This is the status channel
14os.dup2(2,3)
15# Join our stderr in with our stdout
16os.dup2(1,2)
17
18autodir = os.path.dirname(sys.argv[0])
19autotest = os.path.join(autodir, 'autotest')
jadmanskifd5f6872008-12-15 17:28:36 +000020
21args = [autotest] + sys.argv[1:]
22if '-H' not in args:
23 args.insert(1, '-H simple')
24cmd = ' '.join(args)
jadmanski8d6295d2008-05-29 21:43:35 +000025exit_code = subprocess.call(cmd, shell=True, stderr=subprocess.STDOUT,
jadmanski0afbb632008-06-06 21:10:57 +000026 close_fds=False)
mblighfaf0cd42007-11-19 16:00:24 +000027sys.exit(exit_code) # pass on the exit status from autotest