def test_wpas_ap_open_vht80(dev): """wpa_supplicant AP mode - VHT 80 MHz""" id = dev[0].add_network() dev[0].set("country", "FI") try: dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-open") dev[0].set_network(id, "key_mgmt", "NONE") dev[0].set_network(id, "frequency", "5180") dev[0].set_network(id, "scan_freq", "5180") dev[0].set_network(id, "vht", "1") dev[0].set_network(id, "vht_center_freq1", "5210") dev[0].set_network(id, "max_oper_chwidth", "1") dev[0].set_network(id, "ht40", "1") dev[0].select_network(id) wait_ap_ready(dev[0]) dev[1].connect("wpas-ap-open", key_mgmt="NONE", scan_freq="5180") sig = dev[1].request("SIGNAL_POLL").splitlines() hwsim_utils.test_connectivity(dev[0], dev[1]) dev[1].request("DISCONNECT") dev[1].wait_disconnected() if "FREQUENCY=5180" not in sig: raise Exception("Unexpected SIGNAL_POLL value(1): " + str(sig)) if "WIDTH=80 MHz" not in sig: raise Exception("Unexpected SIGNAL_POLL value(2): " + str(sig)) finally: set_country("00") dev[0].set("country", "00") dev[1].flush_scan_cache()
def _test_wpas_ap_dfs(dev): set_country("US") dev[0].request("SET country US") id = dev[0].add_network() dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-dfs") dev[0].set_network(id, "key_mgmt", "NONE") dev[0].set_network(id, "frequency", "5260") dev[0].set_network(id, "scan_freq", "5260") dev[0].select_network(id) ev = dev[0].wait_event(["DFS-CAC-START"]) if ev is None: # For now, assume DFS is not supported by all kernel builds. raise HwsimSkip("CAC did not start - assume not supported") ev = dev[0].wait_event(["DFS-CAC-COMPLETED"], timeout=70) if ev is None: raise Exception("CAC did not complete") if "success=1" not in ev: raise Exception("CAC failed") if "freq=5260" not in ev: raise Exception("Unexpected DFS freq result") ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"]) if ev is None: raise Exception("AP failed to start") dev[1].connect("wpas-ap-dfs", key_mgmt="NONE") dev[1].wait_regdom(country_ie=True) dev[0].request("DISCONNECT") dev[1].disconnect_and_stop_scan()
def _test_wpas_ap_dfs(dev): set_country("US") dev[0].request("SET country US") id = dev[0].add_network() dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-dfs") dev[0].set_network(id, "key_mgmt", "NONE") dev[0].set_network(id, "frequency", "5260") dev[0].set_network(id, "scan_freq", "5260") dev[0].select_network(id) ev = dev[0].wait_event(["DFS-CAC-START"]) if ev is None: # For now, assume DFS is not supported by all kernel builds. raise HwsimSkip("CAC did not start - assume not supported") ev = dev[0].wait_event(["DFS-CAC-COMPLETED"], timeout=70) if ev is None: raise Exception("CAC did not complete") if "success=1" not in ev: raise Exception("CAC failed") if "freq=5260" not in ev: raise Exception("Unexpected DFS freq result") ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"]) if ev is None: raise Exception("AP failed to start") dev[1].connect("wpas-ap-dfs", key_mgmt="NONE")
def test_wpas_ap_5ghz(dev): """wpa_supplicant AP mode - 5 GHz""" try: _test_wpas_ap_5ghz(dev) finally: set_country("00") dev[0].request("SET country 00") dev[1].flush_scan_cache()
def test_wpas_ap_dfs(dev): """wpa_supplicant AP mode - DFS""" try: _test_wpas_ap_dfs(dev) finally: set_country("00") dev[0].request("SET country 00") dev[1].flush_scan_cache()
def test_wpas_ap_dfs(dev): """wpa_supplicant AP mode - DFS""" if dev[0].get_mcc() > 1: raise HwsimSkip("DFS is not supported with multi channel contexts") try: _test_wpas_ap_dfs(dev) finally: set_country("00") dev[0].request("SET country 00") dev[1].flush_scan_cache()
def _test_wpas_ap_5ghz(dev): set_country("US") dev[0].request("SET country US") id = dev[0].add_network() dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-5ghz") dev[0].set_network(id, "key_mgmt", "NONE") dev[0].set_network(id, "frequency", "5180") dev[0].set_network(id, "scan_freq", "5180") dev[0].select_network(id) wait_ap_ready(dev[0]) dev[1].connect("wpas-ap-5ghz", key_mgmt="NONE", scan_freq="5180") dev[1].request("DISCONNECT") dev[1].wait_disconnected()
def test_discovery_restart_progressive(dev): """P2P device discovery and p2p_find type=progressive restart""" try: set_country("US", dev[1]) autogo(dev[1], freq=5805) dev[0].p2p_find(social=True) dev[0].p2p_stop_find() dev[0].p2p_find(progressive=True) ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=20) dev[1].remove_group() if ev is None: raise Exception("Peer not found") finally: set_country("00") dev[1].flush_scan_cache()
def test_wpas_ap_async_fail(dev): """wpa_supplicant AP mode - Async failure""" id = dev[0].add_network() dev[0].set("country", "FI") try: dev[0].set_network(id, "mode", "2") dev[0].set_network_quoted(id, "ssid", "wpas-ap-open") dev[0].set_network(id, "key_mgmt", "NONE") dev[0].set_network(id, "frequency", "5180") dev[0].set_network(id, "scan_freq", "5180") dev[0].set_network(id, "vht", "1") dev[0].set_network(id, "vht_center_freq1", "5210") dev[0].set_network(id, "max_oper_chwidth", "1") dev[0].set_network(id, "ht40", "1") with alloc_fail(dev[0], 1, "nl80211_get_scan_results;ieee80211n_check_scan"): dev[0].select_network(id) dev[0].wait_disconnected() finally: set_country("00") dev[0].set("country", "00")