Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] qemuimagetest debugging improvements
@ 2013-03-26 12:43 Paul Eggleton
  2013-03-26 12:43 ` [PATCH 1/2] qemuimagetest: fix erroneous ps errors when qemu couldn't be started Paul Eggleton
  2013-03-26 12:43 ` [PATCH 2/2] qemuimagetest: collect and print runqemu output Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-03-26 12:43 UTC (permalink / raw)
  To: openembedded-core

A couple of fixes to hopefully help us track down the qemuimagetest
failures on the autobuilder.


The following changes since commit d60aec3f5b319f4583fa72a8357b9ddd3be62b1a:

  docbook-utils-native: Unbreak the build after source and build dir split (2013-03-25 20:51:15 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/qemuimagetest
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/qemuimagetest

Paul Eggleton (2):
  qemuimagetest: fix erroneous ps errors when qemu couldn't be started
  qemuimagetest: collect and print runqemu output

 meta/classes/imagetest-qemu.bbclass    |    1 +
 scripts/qemuimage-testlib              |   12 +++++++++---
 scripts/qemuimage-testlib-pythonhelper |    2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)

-- 
1.7.10.4




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] qemuimagetest: fix erroneous ps errors when qemu couldn't be started
  2013-03-26 12:43 [PATCH 0/2] qemuimagetest debugging improvements Paul Eggleton
@ 2013-03-26 12:43 ` Paul Eggleton
  2013-03-26 12:43 ` [PATCH 2/2] qemuimagetest: collect and print runqemu output Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-03-26 12:43 UTC (permalink / raw)
  To: openembedded-core

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(-)

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 = []
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] qemuimagetest: collect and print runqemu output
  2013-03-26 12:43 [PATCH 0/2] qemuimagetest debugging improvements Paul Eggleton
  2013-03-26 12:43 ` [PATCH 1/2] qemuimagetest: fix erroneous ps errors when qemu couldn't be started Paul Eggleton
@ 2013-03-26 12:43 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2013-03-26 12:43 UTC (permalink / raw)
  To: openembedded-core

If runqemu (or qemu itself) fails we need to know why, so tee out to a
log file and print it when we can't find the qemu process or determine
its IP address.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/imagetest-qemu.bbclass |    1 +
 scripts/qemuimage-testlib           |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/classes/imagetest-qemu.bbclass b/meta/classes/imagetest-qemu.bbclass
index 0d18f06..63ba087 100644
--- a/meta/classes/imagetest-qemu.bbclass
+++ b/meta/classes/imagetest-qemu.bbclass
@@ -74,6 +74,7 @@ def qemuimagetest_main(d):
         os.environ["TARGET_IPSAVE"] = d.getVar("TARGET_IPSAVE", True)
         os.environ["TEST_SERIALIZE"] = d.getVar("TEST_SERIALIZE", True)
         os.environ["SDK_NAME"] = d.getVar("SDK_NAME", True)
+        os.environ["RUNQEMU_LOGFILE"] = d.expand("${T}/log.runqemutest.%s" % os.getpid())
 
         # Add in all variables from the user's original environment which
         # haven't subsequntly been set/changed
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 6377c7f..a800f68 100755
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -408,8 +408,8 @@ Test_Create_Qemu()
 		export MACHINE=$QEMUARCH
 
 		# Create Qemu in localhost VNC Port 1
-		echo "Running xterm -display ${DISPLAY} -e 'OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} || /bin/sleep 60' &"
-		xterm -display ${DISPLAY} -e "OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} || /bin/sleep 60" &
+		echo "Running xterm -display ${DISPLAY} -e 'OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} | tee ${RUNQEMU_LOGFILE} || /bin/sleep 60' &"
+		xterm -display ${DISPLAY} -e "OE_TMPDIR=${OE_TMPDIR} ${RUNQEMU} ${KERNEL} ${TEST_ROOTFS_IMAGE} | tee ${RUNQEMU_LOGFILE} || /bin/sleep 60" &
 	
 		# Get the pid of the xterm processor, which will be used in Test_Kill_Qemu
 		XTERMPID=$!
@@ -436,6 +436,9 @@ Test_Create_Qemu()
 		Test_Info "No qemu process appeared to start, exiting"
 		ps axww -O ppid
 		Test_Info "Process list dumped for debugging purposes"
+		Test_Info "runqemu output log:"
+		cat ${RUNQEMU_LOGFILE}
+		echo
 		return 1
 	fi
 
@@ -446,6 +449,9 @@ Test_Create_Qemu()
 		Test_Info "There is no qemu process or qemu ip address found, return failed"
 		ps -wwf
 		ps axww -O ppid
+		Test_Info "runqemu output log:"
+		cat ${RUNQEMU_LOGFILE}
+		echo
 		return 1
 	fi
 
-- 
1.7.10.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-26 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26 12:43 [PATCH 0/2] qemuimagetest debugging improvements Paul Eggleton
2013-03-26 12:43 ` [PATCH 1/2] qemuimagetest: fix erroneous ps errors when qemu couldn't be started Paul Eggleton
2013-03-26 12:43 ` [PATCH 2/2] qemuimagetest: collect and print runqemu output Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox