From 4a7d73d1619218a21dbd795fe2edbefab228ae9b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Sep 2014 17:51:09 +0300 Subject: [PATCH] tests: Make ap_hs20_random_mac_addr more robust If the previuous test case used a non-RSN AP and that was left in cfg80211 scan results, it was possible for ap_hs20_random_mac_addr to pick that old AP from the previous test and reject to connect through Hotspot 2.0 mechanisms. Work around this test issue by requesting new set of scan result at the beginning of the test. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index f5744195e..b06078978 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -2086,6 +2086,7 @@ def test_ap_hs20_random_mac_addr(dev, apdev): wpas.request("SET preassoc_mac_addr 1") wpas.request("SET rand_addr_lifetime 60") wpas.hs20_enable() + wpas.scan(freq="2412", only_new=True) id = wpas.add_cred_values({ 'realm': "example.com", 'username': "hs20-test", 'password': "password", @@ -2094,7 +2095,6 @@ def test_ap_hs20_random_mac_addr(dev, apdev): 'update_identifier': "1234" }) interworking_select(wpas, bssid, "home", freq="2412") interworking_connect(wpas, bssid, "TTLS") - check_sp_type(wpas, "home") addr1 = wpas.get_driver_status_field("addr") if addr == addr1: raise Exception("Did not use random MAC address")