diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index 94ff38a61..ec126e666 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -283,7 +283,6 @@ def test_ap_acs_vht160(dev, apdev): params['country_code'] = 'ZA' params['ieee80211ac'] = '1' params['vht_oper_chwidth'] = '2' - params["vht_oper_centr_freq_seg0_idx"] = "114" params['ieee80211d'] = '1' params['ieee80211h'] = '1' params['chanlist'] = '100' @@ -439,3 +438,52 @@ def test_ap_acs_dfs(dev, apdev, params): hostapd.cmd_execute(apdev[0], ['iw', 'reg', 'set', '00']) dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5) dev[0].flush_scan_cache() + +def test_ap_acs_vht160_dfs(dev, apdev, params): + """Automatic channel selection 160 MHz, HT scan, and DFS [long]""" + if not params['long']: + raise HwsimSkip("Skip test case with long duration due to --long not specified") + try: + hapd = None + force_prev_ap_on_5g(apdev[0]) + params = hostapd.wpa2_params(ssid="test-acs", passphrase="12345678") + params['hw_mode'] = 'a' + params['channel'] = '0' + params['ht_capab'] = '[HT40+]' + params['country_code'] = 'US' + params['ieee80211ac'] = '1' + params['vht_oper_chwidth'] = '2' + params['ieee80211d'] = '1' + params['ieee80211h'] = '1' + params['acs_num_scans'] = '1' + hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False) + wait_acs(hapd, return_after_acs=True) + + wait_dfs_event(hapd, "DFS-CAC-START", 5) + ev = wait_dfs_event(hapd, "DFS-CAC-COMPLETED", 70) + if "success=1" not in ev: + raise Exception("CAC failed") + + ev = hapd.wait_event(["AP-ENABLED"], timeout=5) + if not ev: + raise Exception("AP setup timed out") + + state = hapd.get_status_field("state") + if state != "ENABLED": + raise Exception("Unexpected interface state") + + freq = int(hapd.get_status_field("freq")) + if freq not in [ 5180, 5500 ]: + raise Exception("Unexpected frequency: %d" % freq) + + dev[0].connect("test-acs", psk="12345678", scan_freq=str(freq)) + dev[0].wait_regdom(country_ie=True) + finally: + if hapd: + hapd.request("DISABLE") + dev[0].request("DISCONNECT") + dev[0].request("ABORT_SCAN") + dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.5) + hostapd.cmd_execute(apdev[0], ['iw', 'reg', 'set', '00']) + dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5) + dev[0].flush_scan_cache()