diff --git a/tests/hwsim/stop-wifi.sh b/tests/hwsim/stop-wifi.sh index 184ce8467..20efc2d9e 100755 --- a/tests/hwsim/stop-wifi.sh +++ b/tests/hwsim/stop-wifi.sh @@ -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