summaryrefslogtreecommitdiffstats
path: root/scripts/qemuimage-testlib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-21 14:29:57 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-27 17:28:01 +0000
commit317301d146287f20922773b5bf4f59737b60f8af (patch)
treed1e4afeb0f59197caf85eb7552b87c53dde9da30 /scripts/qemuimage-testlib
parentfd428a09eeda0199cc1ff53c6ea858cf35d36762 (diff)
downloadpoky-317301d146287f20922773b5bf4f59737b60f8af.tar.gz
poky-317301d146287f20922773b5bf4f59737b60f8af.tar.bz2
poky-317301d146287f20922773b5bf4f59737b60f8af.zip
scripts/qemu-testlib: Add more debugging information
This extra information should allow better forensics if the sanity tests fail as they're currently doing occasionaly on the autobuilder for unknown reasons. The patch also tightens up certain checks to remove pointless noise and error output from the logs. (From OE-Core rev: aef04b2247137fffb8c1b1d776091bbee8637ff9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/qemuimage-testlib')
-rwxr-xr-xscripts/qemuimage-testlib31
1 files changed, 21 insertions, 10 deletions
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 11768d001a..551011cbaf 100755
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -69,7 +69,7 @@ Test_Update_IPSAVE()
local pid=$1
local ip_addr=$2
- if [ "$TEST_SERIALIZE" -eq 1 ]; then
+ if [ "$TEST_SERIALIZE" -eq 1 -a "$pid" != "0" -a "$pid" != "" -a "$ip_addr" != "" -a "$ip_addr" != "" ]; then
echo "Saving $pid $ip_addr to $TARGET_IPSAVE"
echo "$pid $ip_addr" > $TARGET_IPSAVE
fi
@@ -234,15 +234,19 @@ Test_Kill_Qemu()
fi
if [ $k -eq 1 ]; then
- running=`ps -wwfp $QEMUPID`
- if [ $? -eq 0 ]; then
- echo "killing $QEMUPID"
- kill $QEMUPID
+ if [ "$QEMUPID" != "0" -a "$QEMUPID" != "" ]; then
+ running=`ps -wwfp $QEMUPID`
+ if [ $? -eq 0 ]; then
+ echo "killing $QEMUPID"
+ kill $QEMUPID
+ fi
fi
- running=`ps -wwfp $XTERMPID`
- if [ $? -eq 0 ]; then
- echo "killing $XTERMPID"
- kill $XTERMPID
+ if [ "$XTERMPID" != "0" -a "$XTERMPID" != "" ]; then
+ running=`ps -wwfp $XTERMPID`
+ if [ $? -eq 0 ]; then
+ echo "killing $XTERMPID"
+ kill $XTERMPID
+ fi
fi
fi
@@ -336,6 +340,11 @@ Test_Fetch_Target_IP()
local opid=$1
local ip_addr=0
+ if [ "$opid" = "0" -o "$opid" = "" ]; then
+ echo ""
+ return
+ fi
+
# Check if $1 pid exists and contains ipaddr of target
ip_addr=`ps -wwfp $opid | grep -o "192\.168\.7\.[0-9]*::" | awk -F":" '{print $1}'`
@@ -433,8 +442,10 @@ Test_Create_Qemu()
# Parse IP address of target from the qemu command line
TARGET_IPADDR=`Test_Fetch_Target_IP $QEMUPID`
echo "Target IP is ${TARGET_IPADDR}"
- if [ -z ${TARGET_IPADDR} -o "${TARGET_IPADDR}" = "0" ]; then
+ if [ ${TARGET_IPADDR} = "" -o "${TARGET_IPADDR}" = "0" ]; then
Test_Info "There is no qemu process or qemu ip address found, return failed"
+ ps -wwf
+ ps axww -O ppid
return 1
fi