From 4816bd3b22b8e3e172c6a1c526230b60988fd986 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 12 Oct 2018 19:20:33 +0300 Subject: [PATCH] tests: OWE transition mode and need for multiple scans Signed-off-by: Jouni Malinen --- tests/hwsim/test_owe.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/tests/hwsim/test_owe.py b/tests/hwsim/test_owe.py index 980926743..7674122c8 100644 --- a/tests/hwsim/test_owe.py +++ b/tests/hwsim/test_owe.py @@ -220,6 +220,41 @@ def test_owe_transition_mode_open_only_ap(dev, apdev): if val != "NONE": raise Exception("Unexpected key_mgmt: " + val) +def test_owe_transition_mode_open_multiple_scans(dev, apdev): + """Opportunistic Wireless Encryption transition mode and need for multiple scans""" + if "OWE" not in dev[0].get_capability("key_mgmt"): + raise HwsimSkip("OWE not supported") + dev[0].flush_scan_cache() + params = { "ssid": "owe-test", + "owe_transition_bssid": apdev[0]['bssid'], + "owe_transition_ssid": '"owe-random"' } + hapd2 = hostapd.add_ap(apdev[1], params) + bssid2 = hapd2.own_addr() + + dev[0].scan_for_bss(bssid2, freq="2412") + + dev[0].dump_monitor() + id = dev[0].connect("owe-test", key_mgmt="OWE", ieee80211w="2", + scan_freq="2412", wait_connect=False) + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=1) + + params = { "ssid": "owe-random", + "wpa": "2", + "wpa_key_mgmt": "OWE", + "rsn_pairwise": "CCMP", + "ieee80211w": "2", + "owe_transition_bssid": apdev[1]['bssid'], + "owe_transition_ssid": '"owe-test"', + "ignore_broadcast_ssid": "1" } + hapd = hostapd.add_ap(apdev[0], params) + bssid = hapd.own_addr() + + dev[0].wait_connected() + + val = dev[0].get_status_field("key_mgmt") + if val != "OWE": + raise Exception("Unexpected key_mgmt: " + val) + def test_owe_transition_mode_multi_bss(dev, apdev): """Opportunistic Wireless Encryption transition mode (multi BSS)""" try: