tests: Wait longer for program deinit

Wait a bit longer for wpa_supplicant/hostapd to exit and clear control
interface files separately if either any of the cleanup steps fail to do
so.

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-08-27 16:02:15 +03:00
parent 15f7b02c95
commit 18ece3133e

View file

@ -1,6 +1,6 @@
#!/bin/sh
if pidof wpa_supplicant hostapd > /dev/null; then
if pidof wpa_supplicant hostapd valgrind.bin > /dev/null; then
RUNNING=yes
else
RUNNING=no
@ -21,7 +21,7 @@ fi
if [ "$RUNNING" = "yes" ]; then
# give some time for hostapd and wpa_supplicant to complete deinit
sleep 2
sleep 4
fi
if pidof wpa_supplicant hostapd > /dev/null; then
@ -38,6 +38,16 @@ for i in `pidof valgrind.bin`; do
fi
done
for i in /tmp/wpas-wlan0 /tmp/wpas-wlan1 /tmp/wpas-wlan2 /var/run/hostapd-global; do
if [ -e $i ]; then
sleep 1
if [ -e $i ]; then
echo "Control interface file $i exists - remove it"
sudo rm $i
fi
fi
done
if grep -q mac80211_hwsim /proc/modules ; then
sudo rmmod mac80211_hwsim
# wait at the end to avoid issues starting something new immediately after