From dafe0b642902d54b7118c6add82459774a11c657 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 30 Dec 2015 13:29:32 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_connect_cmd.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/hwsim/test_connect_cmd.py b/tests/hwsim/test_connect_cmd.py index 56e77b670..d6252d5b8 100644 --- a/tests/hwsim/test_connect_cmd.py +++ b/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" }