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
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()
70 local ip_addr=$2 70 local ip_addr=$2
71 71
72 if [ "$TEST_SERIALIZE" -eq 1 ]; then 72 if [ "$TEST_SERIALIZE" -eq 1 ]; then
73 echo "Saving $pid $ip_addr to $TARGET_IPSAVE"
73 echo "$pid $ip_addr" > $TARGET_IPSAVE 74 echo "$pid $ip_addr" > $TARGET_IPSAVE
74 fi 75 fi
75} 76}
@@ -215,6 +216,7 @@ Test_Kill_Qemu()
215{ 216{
216 local index=0 217 local index=0
217 local total=0 218 local total=0
219 local k=0
218 220
219 # When TEST_SERIALIZE is set, qemu process will not be 221 # When TEST_SERIALIZE is set, qemu process will not be
220 # killed until all the cases are finished 222 # killed until all the cases are finished
@@ -222,15 +224,26 @@ Test_Kill_Qemu()
222 index=`sed -n 2p ${TEST_STATUS} | awk '{print $3}'` 224 index=`sed -n 2p ${TEST_STATUS} | awk '{print $3}'`
223 total=`sed -n 2p ${TEST_STATUS} | awk '{print $4}'` 225 total=`sed -n 2p ${TEST_STATUS} | awk '{print $4}'`
224 if [ ${index} != ${total} ]; then 226 if [ ${index} != ${total} ]; then
225 Test_Info "Do not kill the qemu process and use it for later testing" 227 Test_Info "Do not kill the qemu process and use it for later testing (step $index of $total)"
226 Test_Update_IPSAVE $XTERMPID $TARGET_IPADDR 228 Test_Update_IPSAVE $XTERMPID $TARGET_IPADDR
227 else 229 else
228 kill -$QEMUPID 230 k=1
229 kill -$XTERMPID
230 fi 231 fi
231 else 232 else
232 kill -$QEMUPID 233 k=1
233 kill -$XTERMPID 234 fi
235
236 if [ $k -eq 1 ]; then
237 running=`ps -wwfp $QEMUPID`
238 if [ $? -eq 0 ]; then
239 echo "killing $QEMUPID"
240 kill $QEMUPID
241 fi
242 running=`ps -wwfp $XTERMPID`
243 if [ $? -eq 0 ]; then
244 echo "killing $XTERMPID"
245 kill $XTERMPID
246 fi
234 fi 247 fi
235 248
236 return 249 return
@@ -393,6 +406,7 @@ Test_Create_Qemu()
393 406
394 # Get the pid of the xterm processor, which will be used in Test_Kill_Qemu 407 # Get the pid of the xterm processor, which will be used in Test_Kill_Qemu
395 XTERMPID=$! 408 XTERMPID=$!
409 echo "XTERMPID is $XTERMPID"
396 fi 410 fi
397 411
398 while [ ${up_time} -lt 10 ] 412 while [ ${up_time} -lt 10 ]
@@ -404,6 +418,7 @@ Test_Create_Qemu()
404 sleep 5 418 sleep 5
405 else 419 else
406 Test_Info "Begin to check if qemu network is up" 420 Test_Info "Begin to check if qemu network is up"
421 echo "QEMUPID is $QEMUPID"
407 break 422 break
408 fi 423 fi
409 done 424 done