]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Update ap_open_unexpected_assoc_event to match implementation
authorJouni Malinen <jouni@codeaurora.org>
Mon, 21 Dec 2020 13:50:33 +0000 (15:50 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 21 Dec 2020 13:51:32 +0000 (15:51 +0200)
Now that wpa_supplicant ignores the unexpected association event in
disconnected-not-trying-to-connect state, this test cases needs to be
modified to avoid incorrect failures.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_open.py

index 62b44461bf2331139fbc29efcc23387c72d2d234..59b647cde9a7a256d1f68f6ac8a780be60c9b4fa 100644 (file)
@@ -198,19 +198,15 @@ def test_ap_open_unexpected_assoc_event(dev, apdev):
     dev[0].request("DISCONNECT")
     dev[0].wait_disconnected(timeout=15)
     dev[0].dump_monitor()
-    # This will be accepted due to matching network
+    # This association will be ignored by wpa_supplicant since the current
+    # state is not to try to connect after that DISCONNECT command.
     dev[0].cmd_execute(['iw', 'dev', dev[0].ifname, 'connect', 'open', "2412",
                         apdev[0]['bssid']])
-    dev[0].wait_connected(timeout=15)
-    dev[0].dump_monitor()
-
-    dev[0].request("REMOVE_NETWORK all")
-    dev[0].wait_disconnected(timeout=5)
+    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.3)
+    dev[0].cmd_execute(['iw', 'dev', dev[0].ifname, 'disconnect'])
     dev[0].dump_monitor()
-    # This will result in disconnection due to no matching network
-    dev[0].cmd_execute(['iw', 'dev', dev[0].ifname, 'connect', 'open', "2412",
-                        apdev[0]['bssid']])
-    dev[0].wait_disconnected(timeout=15)
+    if ev is not None:
+        raise Exception("Unexpected connection")
 
 def test_ap_open_external_assoc(dev, apdev):
     """AP with open mode and external association"""