From b9e052ed6b604f0049bcfa968a57f15d6e3d6395 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Tue, 19 Mar 2013 11:44:27 +0000 Subject: qemu-testlib: Add python helper and simplify shell The current code has a race since it greps for *any* qemu process running, even if it isn't the one we started. This leads to some sanity tests potentially failing on machines where multiple sets of sanity tests are running. To resovle this and some other ugly code issues, add a python script to accurately walk the process tree and find the qemu process. We can then replace all the shell functions attempting this which happen to work in many cases but not all. Also clean up some of the error handling so its more legible. Signed-off-by: Richard Purdie --- scripts/qemuimage-tests/sanity/shutdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/qemuimage-tests/sanity') diff --git a/scripts/qemuimage-tests/sanity/shutdown b/scripts/qemuimage-tests/sanity/shutdown index d55c859410..c9e931c4c2 100755 --- a/scripts/qemuimage-tests/sanity/shutdown +++ b/scripts/qemuimage-tests/sanity/shutdown @@ -45,7 +45,7 @@ if [ $RET -eq 0 ]; then # If qemu start up process ends up, it means shutdown completes while [ $i -lt $TIMEOUT ] do - ps -fp $PID > /dev/null + ps -fp $QEMUPID > /dev/null 2> /dev/null if [ $? -ne 0 ]; then RET=0 break -- cgit v1.2.3