KVM test: kvm_subprocess: fix a problem that arises with Python 2.6

After launching the server the client waits for it to finish initializing.
This is done by waiting for a line of output from the server's STDOUT.
Currently, the client assumes that the first line of output coming from the
server indicates that it's done initializing.  With Python 2.4 this used to be
true, but Python 2.6 prints deprecation warnings for certain standard modules
as soon as they are imported.  This makes the client think the server is ready
when in fact it isn't.

This patch fixes the problem by waiting for a certain unique output line from
the server instead of just waiting for the first line.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3446 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tests/kvm/kvm_subprocess.py b/client/tests/kvm/kvm_subprocess.py
index 413bdaa..c15e779 100644
--- a/client/tests/kvm/kvm_subprocess.py
+++ b/client/tests/kvm/kvm_subprocess.py
@@ -212,7 +212,8 @@
             sub.stdin.write("%s\n" % ",".join(self.readers))
             sub.stdin.write("%s\n" % command)
             # Wait for the server to complete its initialization
-            sub.stdout.readline()
+            while not "Server %s ready" % self.id in sub.stdout.readline():
+                pass
 
         # Open the reading pipes
         self.reader_fds = {}
@@ -1081,7 +1082,7 @@
         file.close()
 
         # Print something to stdout so the client can start working
-        print "hello"
+        print "Server %s ready" % id
         sys.stdout.flush()
 
         # Initialize buffers