summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-19 20:54:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-27 17:28:00 +0000
commitcaa75bfffb4cd3808aa6a5473f7cc6208e9e934c (patch)
treeb811355dfa0e14e390922d7ace5ef40c5d4b8dea
parentebf1f6dacfb3ef61583c6eeeb0f98191e18f5ad9 (diff)
downloadpoky-caa75bfffb4cd3808aa6a5473f7cc6208e9e934c.tar.gz
poky-caa75bfffb4cd3808aa6a5473f7cc6208e9e934c.tar.bz2
poky-caa75bfffb4cd3808aa6a5473f7cc6208e9e934c.zip
scripts/qemutestlib: Add better process debugging and fix process group issue
In single testing with a shutdown scenario the processes are cleaned up correctly but the manual cleanup fall back used for a minimal image do not work properly. This patch fixes the kill commands to revert to non-process groups, fixing the hung process issues that were occuring. (From OE-Core rev: 1c7d4fc88a9e7a3cdb41044ce7eedadd38e99952) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xscripts/qemuimage-testlib25
1 files changed, 20 insertions, 5 deletions
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 2c22bf2fa6..5d74a0a739 100755
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -70,6 +70,7 @@ Test_Update_IPSAVE()
local ip_addr=$2
if [ "$TEST_SERIALIZE" -eq 1 ]; then
+ echo "Saving $pid $ip_addr to $TARGET_IPSAVE"
echo "$pid $ip_addr" > $TARGET_IPSAVE
fi
}
@@ -215,6 +216,7 @@ Test_Kill_Qemu()
{
local index=0
local total=0
+ local k=0
# When TEST_SERIALIZE is set, qemu process will not be
# killed until all the cases are finished
@@ -222,15 +224,26 @@ Test_Kill_Qemu()
index=`sed -n 2p ${TEST_STATUS} | awk '{print $3}'`
total=`sed -n 2p ${TEST_STATUS} | awk '{print $4}'`
if [ ${index} != ${total} ]; then
- Test_Info "Do not kill the qemu process and use it for later testing"
+ Test_Info "Do not kill the qemu process and use it for later testing (step $index of $total)"
Test_Update_IPSAVE $XTERMPID $TARGET_IPADDR
else
- kill -$QEMUPID
- kill -$XTERMPID
+ k=1
fi
else
- kill -$QEMUPID
- kill -$XTERMPID
+ k=1
+ fi
+
+ if [ $k -eq 1 ]; then
+ running=`ps -wwfp $QEMUPID`
+ if [ $? -eq 0 ]; then
+ echo "killing $QEMUPID"
+ kill $QEMUPID
+ fi
+ running=`ps -wwfp $XTERMPID`
+ if [ $? -eq 0 ]; then
+ echo "killing $XTERMPID"
+ kill $XTERMPID
+ fi
fi
return
@@ -393,6 +406,7 @@ Test_Create_Qemu()
# Get the pid of the xterm processor, which will be used in Test_Kill_Qemu
XTERMPID=$!
+ echo "XTERMPID is $XTERMPID"
fi
while [ ${up_time} -lt 10 ]
@@ -404,6 +418,7 @@ Test_Create_Qemu()
sleep 5
else
Test_Info "Begin to check if qemu network is up"
+ echo "QEMUPID is $QEMUPID"
break
fi
done