Patchwork [1/2] qemuimagetest: fix erroneous ps errors when qemu couldn't be started

login
register
mail settings
Submitter Paul Eggleton
Date March 26, 2013, 12:43 p.m.
Message ID <42427ce8cd1e9bf6907e56fb8dc09837c28a72ba.1364301448.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/46925/
State Accepted
Commit b45d63e2ecbc03c1aaebb619e3eea840e163699b
Headers show

Comments

Paul Eggleton - March 26, 2013, 12:43 p.m.
The helper script was printing an error to stdout when it couldn't find
any qemu child processes; output this error to stderr instead and
redirect stderr to /dev/null when running from qemuimage-testlib so that
QEMUPID is actually blank if there are no qemu instances found.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/qemuimage-testlib              |    2 +-
 scripts/qemuimage-testlib-pythonhelper |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 551011c..6377c7f 100755
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -420,7 +420,7 @@  Test_Create_Qemu()
 
 	while [ ${up_time} -lt 10 ]
 	do
-		QEMUPID=`qemuimage-testlib-pythonhelper --findqemu $XTERMPID`
+		QEMUPID=`qemuimage-testlib-pythonhelper --findqemu $XTERMPID 2>/dev/null`
 		if [ $? -ne 0 ]; then
 			Test_Info "Wait for qemu up..."
 			up_time=`expr $up_time + 5`
diff --git a/scripts/qemuimage-testlib-pythonhelper b/scripts/qemuimage-testlib-pythonhelper
index 2ca61ca..2c1f557 100755
--- a/scripts/qemuimage-testlib-pythonhelper
+++ b/scripts/qemuimage-testlib-pythonhelper
@@ -34,7 +34,7 @@  if options.findqemu:
         commands[data[0]] = data[2]
 
     if options.findqemu not in pids:
-        print "No children found matching %s" % options.findqemu
+        sys.stderr.write("No children found matching %s" % options.findqemu)
         sys.exit(1)
 
     parents = []