diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 9bcbab5eb..49b9c65d0 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -717,6 +717,7 @@ def policy_test(dev, ap, values, only_one=True): events = [] while True: ev = dev.wait_event(["INTERWORKING-AP", "INTERWORKING-NO-MATCH", + "INTERWORKING-BLACKLISTED", "INTERWORKING-SELECTED"], timeout=15) if ev is None: raise Exception("Network selection timed out") @@ -777,9 +778,15 @@ def test_ap_hs20_excluded_ssid(dev, apdev): values = default_cred() values['excluded_ssid'] = "test-hs20" - policy_test(dev[0], apdev[1], values) + events = policy_test(dev[0], apdev[1], values) + ev = [e for e in events if "INTERWORKING-BLACKLISTED " + apdev[0]['bssid'] in e] + if len(ev) != 1: + raise Exception("Excluded network not reported") values['excluded_ssid'] = "test-hs20-other" - policy_test(dev[0], apdev[0], values) + events = policy_test(dev[0], apdev[0], values) + ev = [e for e in events if "INTERWORKING-BLACKLISTED " + apdev[1]['bssid'] in e] + if len(ev) != 1: + raise Exception("Excluded network not reported") def test_ap_hs20_roam_to_higher_prio(dev, apdev): """Hotspot 2.0 and roaming from current to higher priority network"""