virt.virt_test_utils: run_autotest - 'tar' needs relative paths to strip the leading '/'
[autotest-zwu.git] / client / bin / autotest_client
blob46f9a7155093d692f836ed0262352f587da8436a
1 #!/usr/bin/python
2 import common
4 import sys, os, time, subprocess
6 from autotest_lib.client.common_lib import utils
8 # 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.
13 # Set up file descriptor 3 as a copy of our stderr. This is the status channel
14 os.dup2(2,3)
15 # Join our stderr in with our stdout
16 os.dup2(1,2)
18 autodir = os.path.dirname(sys.argv[0])
19 autotest = os.path.join(autodir, 'autotest')
21 args = [autotest] + sys.argv[1:]
22 if '-H' not in args:
23 args.insert(1, '-H simple')
24 cmd = ' '.join(args)
25 exit_code = subprocess.call(cmd, shell=True, stderr=subprocess.STDOUT,
26 close_fds=False)
27 sys.exit(exit_code) # pass on the exit status from autotest