From de677292d53f1d0c3229368cc71c6f8904365281 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 25 Dec 2014 13:30:54 +0200 Subject: [PATCH] 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 --- tests/hwsim/build.sh | 2 +- tests/hwsim/start.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/build.sh b/tests/hwsim/build.sh index bd337e062..f450af7e0 100755 --- a/tests/hwsim/build.sh +++ b/tests/hwsim/build.sh @@ -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 diff --git a/tests/hwsim/start.sh b/tests/hwsim/start.sh index 3dde3b34f..d0015fa3c 100755 --- a/tests/hwsim/start.sh +++ b/tests/hwsim/start.sh @@ -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