]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make pmksa_cache_preauth_auto more robust
authorJouni Malinen <j@w1.fi>
Tue, 28 May 2019 14:14:33 +0000 (17:14 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 28 May 2019 14:14:33 +0000 (17:14 +0300)
It is fine for the station to associate with either AP in this test
case, so do not force AP side connection check with apdev[0].

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_eap.py
tests/hwsim/test_pmksa_cache.py

index 6e7741bc1575651547cafc38160a76a25a864f54..06eee3f958b4db9bd4b4ac17b98d238bc7055f7b 100644 (file)
@@ -149,9 +149,10 @@ def eap_connect(dev, hapd, method, identity,
                    expect_cert_error=expect_cert_error)
     if expect_failure:
         return id
-    ev = hapd.wait_event(["AP-STA-CONNECTED"], timeout=5)
-    if ev is None:
-        raise Exception("No connection event received from hostapd")
+    if hapd:
+        ev = hapd.wait_event(["AP-STA-CONNECTED"], timeout=5)
+        if ev is None:
+            raise Exception("No connection event received from hostapd")
     return id
 
 def eap_check_auth(dev, method, initial, rsn=True, sha256=False,
index a2c0e19750f1c22134e73611249797ff41eca695..1d0a708fae62c9000b67abadef13af9e9e7d1d53 100644 (file)
@@ -455,7 +455,7 @@ def run_pmksa_cache_preauth_auto(dev, apdev):
     hapd.cmd_execute(['ip', 'link', 'set', 'dev', 'ap-br0', 'up'])
     hapd2 = hostapd.add_ap(apdev[1], params)
 
-    eap_connect(dev[0], hapd, "PAX", "pax.user@example.com",
+    eap_connect(dev[0], None, "PAX", "pax.user@example.com",
                 password_hex="0123456789abcdef0123456789abcdef")
 
     found = False