Add simple server harness support to autotest client

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@388 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/bin/autotest_client b/client/bin/autotest_client
new file mode 100755
index 0000000..f184eba
--- /dev/null
+++ b/client/bin/autotest_client
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+import sys, os, time
+from subprocess import *
+
+# We want to set the output (stdout&stderr) of the autotest binary onto our
+# stdout channel. We went to get the status stream of autotest back on our
+# stderr channel - we set up fd 3 for this, and harness_simple.py can
+# open it later.
+
+# Set up file descriptor 3 as a copy of our stderr. This is the status channel
+os.dup2(2,3)
+# Join our stderr in with our stdout
+os.dup2(1,2)
+
+autodir = os.path.dirname(sys.argv[0])
+autotest = os.path.join(autodir, 'autotest')
+cmd = ' '.join([autotest, '-H simple'] + sys.argv[1:])
+p = Popen(cmd, shell=True, stderr=STDOUT, close_fds=False)
+os.waitpid(p.pid, 0)