summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-12-23 17:28:47 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-12-23 17:28:47 +0000
commit11833f70024e9d1199b911734c0d385a423d0c73 (patch)
tree73024559f38405ed59e71f04f2cabde05cd74bd9 /scripts
parentdf74cf25f0904562623a15b641a7770d2fa88570 (diff)
downloadopenembedded-core-11833f70024e9d1199b911734c0d385a423d0c73.tar.gz
openembedded-core-11833f70024e9d1199b911734c0d385a423d0c73.tar.bz2
openembedded-core-11833f70024e9d1199b911734c0d385a423d0c73.zip
qemuimage-testlib: Fix the check for running qemu processes
Previously, any active command containing the word "qemu" including in the command path would trigger a "success" result for detecting the qemu process. This change fixes the check to search for commands starting with "qemu" and ignores pathnames. It also shortens the timeout for the qemu process to appear to 10 seconds. If it doesn't appear in that time there is always a problem. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qemuimage-testlib8
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 79882d9ea7..2c38b9413b 100644
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -204,8 +204,8 @@ Test_Kill_Qemu()
# function to check if there is any qemu process
Test_Check_Qemu_UP()
{
- local count=`ps -ef | grep -c qemu`
- if [ ${count} -lt 2 ]; then
+ local count=`ps -eo command | cut -d " " -f 1 | grep -c \(^qemu\|.*/qemu\)`
+ if [ ${count} -lt 1 ]; then
Test_Info "There is no Qemu process"
return 1
else
@@ -402,9 +402,7 @@ Test_Create_Qemu()
# Get the pid of the xterm processor, which will be used in Test_Kill_Qemu
PID=$!
- sleep 5
-
- while [ ${up_time} -lt ${timeout} ]
+ while [ ${up_time} -lt 10 ]
do
Test_Check_Qemu_UP
if [ $? -ne 0 ]; then