tests: Verify that hostapd-as-RADIUS-server started

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>
This commit is contained in:
Jouni Malinen 2014-12-25 13:30:54 +02:00
parent ed8a1fa496
commit de677292d5
2 changed files with 13 additions and 1 deletions

View file

@ -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

View file

@ -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