From 024913a1566c54fb92995528440867b115734a32 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 26 Aug 2013 11:28:32 +0300 Subject: [PATCH] tests: Stop valgrind.bin regardless of which option is started The previous design of having to provide valgrind parameter to stop-wifi.sh did not work since the new test setup may no match the previous one. Instead of trying to figure out what needs to be stopped based on previous run, stop all wpa_supplicant/hostapd processes running under valgrind unconditionally to avoid cases where new set of processes cannot be started due to existing processed. Signed-hostap: Jouni Malinen --- tests/hwsim/run-all.sh | 4 ++-- tests/hwsim/stop-wifi.sh | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/run-all.sh b/tests/hwsim/run-all.sh index 984d75474..45d2b66da 100755 --- a/tests/hwsim/run-all.sh +++ b/tests/hwsim/run-all.sh @@ -11,7 +11,7 @@ if [ "x$1" = "xconcurrent-valgrind" ]; then ./run-tests.py -l logs/$DATE-run-$i -e logs/$DATE-failed-$i -f test_p2p_$i.py || errors=1 cat logs/$DATE-run-$i >> logs/last-debug done - ./stop-wifi.sh valgrind + ./stop-wifi.sh failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l` if [ $failures -gt 0 ]; then echo "Mark as failed due to valgrind errors" @@ -39,7 +39,7 @@ elif [ "x$1" = "xvalgrind" ]; then DATE=`ls -1tr logs | tail -1 | cut -f1 -d-` ./run-tests.py -l logs/$DATE-run -e logs/$DATE-failed || errors=1 cat logs/$DATE-run > logs/last-debug - ./stop-wifi.sh valgrind + ./stop-wifi.sh failures=`grep "ERROR SUMMARY" logs/$DATE-valgrind-* | grep -v " 0 errors" | wc -l` if [ $failures -gt 0 ]; then echo "Mark as failed due to valgrind errors" diff --git a/tests/hwsim/stop-wifi.sh b/tests/hwsim/stop-wifi.sh index a9f286503..a4255bada 100755 --- a/tests/hwsim/stop-wifi.sh +++ b/tests/hwsim/stop-wifi.sh @@ -2,9 +2,11 @@ sudo killall -q hostapd sudo killall -q wpa_supplicant -if [ "x$1" = "xvalgrind" ]; then - sudo kill `pidof valgrind.bin` -fi +for i in `pidof valgrind.bin`; do + if ps $i | grep -q -E "wpa_supplicant|hostapd"; then + sudo kill $i + fi +done sudo killall -q wlantest sudo killall -q tcpdump if grep -q hwsim0 /proc/net/dev; then