]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: acs_exclude_dfs=1
authorJouni Malinen <j@w1.fi>
Sun, 11 Aug 2019 13:02:43 +0000 (16:02 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Aug 2019 13:37:48 +0000 (16:37 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_acs.py

index 43a34dd783d434a6f930fb5b629205c0f20659a8..dbee35e624ae87ec63c35a962692b5f82f432b34 100644 (file)
@@ -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']: