]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make ap_hs20_random_mac_addr more robust
authorJouni Malinen <j@w1.fi>
Sun, 28 Sep 2014 14:51:09 +0000 (17:51 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 28 Sep 2014 14:51:09 +0000 (17:51 +0300)
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 <j@w1.fi>
tests/hwsim/test_ap_hs20.py

index f5744195ee4c2949d34fe4698a43e5e6f9ca9828..b060789786eb992db2839cce2d102c12a640de4b 100644 (file)
@@ -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")