tests: Clean up at the end of connect_cmd_disconnect_event
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 30 Dec 2015 11:29:32 +0000 (13:29 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 30 Dec 2015 11:29:32 +0000 (13:29 +0200)
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>
tests/hwsim/test_connect_cmd.py

index 56e77b6..d6252d5 100644 (file)
@@ -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" }