From 18ece3133e02e989477cd369ff165b507a4daeb0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 27 Aug 2013 16:02:15 +0300 Subject: [PATCH] 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 --- tests/hwsim/stop-wifi.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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