]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Optimize stop.sh wait times
authorJouni Malinen <j@w1.fi>
Mon, 22 Dec 2014 17:37:08 +0000 (19:37 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Dec 2014 17:37:08 +0000 (19:37 +0200)
There is no need to wait for fixed 0.5 seconds for the processes to
exit.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/stop.sh

index b73d1dcaacc0f26600892b3c48e95438f1c0b324..5d23b5bd68bf9fc380e0656722a8e2b9a1efe9f1 100755 (executable)
@@ -22,13 +22,15 @@ sudo killall -q hlr_auc_gw
 
 if [ "$RUNNING" = "yes" ]; then
     # give some time for hostapd and wpa_supplicant to complete deinit
-    sleep 0.5
-    for i in `seq 1 5`; do
-       if pidof wpa_supplicant hostapd valgrind.bin hlr_auc_gw > /dev/null; then
+    for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
+       if ! pidof wpa_supplicant hostapd valgrind.bin hlr_auc_gw > /dev/null; then
+           break
+       fi
+       if [ $i -gt 10 ]; then
            echo "Waiting for processes to exit (1)"
            sleep 1
        else
-           break
+           sleep 0.06
        fi
     done
 fi