tests: Stop valgrind.bin regardless of which option is started
authorJouni Malinen <j@w1.fi>
Mon, 26 Aug 2013 08:28:32 +0000 (11:28 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 26 Aug 2013 08:28:32 +0000 (11:28 +0300)
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 <j@w1.fi>

tests/hwsim/run-all.sh
tests/hwsim/stop-wifi.sh

index 984d754..45d2b66 100755 (executable)
@@ -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"
index a9f2865..a4255ba 100755 (executable)
@@ -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