]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Check for AP-DISABLED when setting up AP
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 12 Mar 2014 11:35:10 +0000 (13:35 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 12 Mar 2014 11:55:05 +0000 (13:55 +0200)
This allows a critical error to be noticed more quickly and reported
more clearly in the test log.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/hostapd.py

index 984e4cc86a4e7d5d8a578e9b19966a341e5fbd9e..83f070401df52583ce6f433150e2c803fbb13dc9 100644 (file)
@@ -257,9 +257,11 @@ def add_ap(ifname, params, wait_enabled=True):
                 hapd.set(f, v)
         hapd.enable()
         if wait_enabled:
-            ev = hapd.wait_event(["AP-ENABLED"], timeout=30)
+            ev = hapd.wait_event(["AP-ENABLED", "AP-DISABLED"], timeout=30)
             if ev is None:
                 raise Exception("AP startup timed out")
+            if "AP-ENABLED" not in ev:
+                raise Exception("AP startup failed")
         return hapd
 
 def add_bss(phy, ifname, confname, ignore_error=False):