1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-02 13:29:49 +00:00

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: f9970aa0a44aca8ffe6c7a6a3261887fb0db38d2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2013-03-21 14:29:57 +00:00
parent 9ffee9add2
commit 6211a2bdd3
+21 -10
View File
@@ -69,7 +69,7 @@ Test_Update_IPSAVE()
local pid=$1 local pid=$1
local ip_addr=$2 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 "Saving $pid $ip_addr to $TARGET_IPSAVE"
echo "$pid $ip_addr" > $TARGET_IPSAVE echo "$pid $ip_addr" > $TARGET_IPSAVE
fi fi
@@ -234,15 +234,19 @@ Test_Kill_Qemu()
fi fi
if [ $k -eq 1 ]; then if [ $k -eq 1 ]; then
running=`ps -wwfp $QEMUPID` if [ "$QEMUPID" != "0" -a "$QEMUPID" != "" ]; then
if [ $? -eq 0 ]; then running=`ps -wwfp $QEMUPID`
echo "killing $QEMUPID" if [ $? -eq 0 ]; then
kill $QEMUPID echo "killing $QEMUPID"
kill $QEMUPID
fi
fi fi
running=`ps -wwfp $XTERMPID` if [ "$XTERMPID" != "0" -a "$XTERMPID" != "" ]; then
if [ $? -eq 0 ]; then running=`ps -wwfp $XTERMPID`
echo "killing $XTERMPID" if [ $? -eq 0 ]; then
kill $XTERMPID echo "killing $XTERMPID"
kill $XTERMPID
fi
fi fi
fi fi
@@ -336,6 +340,11 @@ Test_Fetch_Target_IP()
local opid=$1 local opid=$1
local ip_addr=0 local ip_addr=0
if [ "$opid" = "0" -o "$opid" = "" ]; then
echo ""
return
fi
# Check if $1 pid exists and contains ipaddr of target # 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}'` 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 # Parse IP address of target from the qemu command line
TARGET_IPADDR=`Test_Fetch_Target_IP $QEMUPID` TARGET_IPADDR=`Test_Fetch_Target_IP $QEMUPID`
echo "Target IP is ${TARGET_IPADDR}" 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" Test_Info "There is no qemu process or qemu ip address found, return failed"
ps -wwf
ps axww -O ppid
return 1 return 1
fi fi