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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-08-26 11:28:32 +03:00
parent e5a3983819
commit 024913a156
2 changed files with 7 additions and 5 deletions

View file

@ -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"

View file

@ -2,9 +2,11 @@
sudo killall -q hostapd
sudo killall -q wpa_supplicant
if [ "x$1" = "xvalgrind" ]; then
sudo kill `pidof valgrind.bin`
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