tests: Verify that hostapd-as-RADIUS-server started
authorJouni Malinen <j@w1.fi>
Thu, 25 Dec 2014 11:30:54 +0000 (13:30 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 26 Dec 2014 11:21:00 +0000 (13:21 +0200)
Large number of test cases will fail if hostapd fails to start as the
RADIUS server. To make this more obvious, verify that the RADIUS server
instance is running and do not even start test execution if the setup if
not work properly.

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

index bd337e0..f450af7 100755 (executable)
@@ -60,7 +60,7 @@ if [ $use_lcov -eq 1 ]; then
 fi
 
 make clean
-make -j8 hostapd hlr_auc_gw
+make -j8 hostapd hostapd_cli hlr_auc_gw
 cd ../wlantest
 make clean
 make -j8
index 3dde3b3..d0015fa 100755 (executable)
@@ -5,6 +5,7 @@ WPAS=$DIR/../../wpa_supplicant/wpa_supplicant
 WPACLI=$DIR/../../wpa_supplicant/wpa_cli
 HAPD=$DIR/../../hostapd/hostapd
 HAPD_AS=$DIR/../../hostapd/hostapd
+HAPDCLI=$DIR/../../hostapd/hostapd_cli
 WLANTEST=$DIR/../../wlantest/wlantest
 HLR_AUC_GW=$DIR/../../hostapd/hlr_auc_gw
 DATE="$(date +%s)"
@@ -147,6 +148,17 @@ for j in `seq 1 10`; do
     sleep 1
 done
 
+for j in `seq 1 10`; do
+    if $HAPDCLI -i as ping | grep -q PONG; then
+       break
+    fi
+    if [ $j = "10" ]; then
+       echo "Could not connect to hostapd-as-RADIUS-server"
+       exit 1
+    fi
+    sleep 1
+done
+
 if [ $USER = "0" -o $USER = "root" ]; then
     exit 0
 fi