From 2d53b0c3d22f95a2f0a6d0d3935c02f101798f8d Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 11 Aug 2019 16:02:43 +0300 Subject: [PATCH] tests: acs_exclude_dfs=1 Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_acs.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index 43a34dd78..dbee35e62 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -400,6 +400,42 @@ def test_ap_acs_dfs(dev, apdev, params): dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5) dev[0].flush_scan_cache() +def test_ap_acs_exclude_dfs(dev, apdev, params): + """Automatic channel selection, exclude DFS""" + 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['ieee80211d'] = '1' + params['ieee80211h'] = '1' + params['acs_num_scans'] = '1' + params['acs_exclude_dfs'] = '1' + hapd = hostapd.add_ap(apdev[0], params, wait_enabled=False) + wait_acs(hapd) + + state = hapd.get_status_field("state") + if state != "ENABLED": + raise Exception("Unexpected interface state") + + freq = int(hapd.get_status_field("freq")) + if freq in [5260, 5280, 5300, 5320, + 5500, 5520, 5540, 5560, 5580, 5600, 5620, 5640, 5660, 5680]: + 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].disconnect_and_stop_scan() + 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']: