Parcourir la source

tests: Clean up at the end of connect_cmd_disconnect_event

This test case used to leave the dynamically added wlan5 interface in a
state where it was still trying to reconnect to a network. This could
result in the following test cases being unable to clear the cfg80211
scan cache. Avoid this type of issues by explicitly stopping the
connection attempt and making sure that there are no scan results in the
cache at the end of connect_cmd_disconnect_event.

The following test case sequence triggered a failure due to the
remaining BSS table entry:
connect_cmd_disconnect_event connect_cmd_wep ap_hs20_random_mac_addr

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen il y a 9 ans
Parent
commit
dafe0b6429
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      tests/hwsim/test_connect_cmd.py

+ 8 - 0
tests/hwsim/test_connect_cmd.py

@@ -163,6 +163,14 @@ def test_connect_cmd_disconnect_event(dev, apdev):
     time.sleep(0.1)
     wpas.dump_monitor()
 
+    # Clean up to avoid causing issue for following test cases
+    wpas.request("REMOVE_NETWORK all")
+    wpas.wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=2)
+    wpas.flush_scan_cache()
+    wpas.dump_monitor()
+    wpas.interface_remove("wlan5")
+    del wpas
+
 def test_connect_cmd_roam(dev, apdev):
     """cfg80211 connect command to trigger roam"""
     params = { "ssid": "sta-connect" }