]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify HT40 coex scan with 20 MHz legacy BSS
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 15 May 2014 22:23:29 +0000 (01:23 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 15 May 2014 22:23:29 +0000 (01:23 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_ap_ht.py

index c301a913829c9bc2a6cf22d91c56f2c792875702..2603181f0b3082fdc38b19973a3aa85c33523f68 100644 (file)
@@ -93,6 +93,45 @@ def test_ap_ht40_scan_conflict(dev, apdev):
 
     dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
 
+def test_ap_ht40_scan_legacy_conflict(dev, apdev):
+    """HT40 co-ex scan conflict with legacy 20 MHz AP"""
+    clear_scan_cache(apdev[0]['ifname'])
+    params = { "ssid": "legacy-20",
+               "channel": "7", "ieee80211n": "0" }
+    hostapd.add_ap(apdev[1]['ifname'], params)
+
+    params = { "ssid": "test-ht40",
+               "channel": "5",
+               "ht_capab": "[HT40-]"}
+    hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
+
+    state = hapd.get_status_field("state")
+    if state != "HT_SCAN":
+        time.sleep(0.1)
+        state = hapd.get_status_field("state")
+        if state != "HT_SCAN":
+            raise Exception("Unexpected interface state - expected HT_SCAN")
+
+    ev = hapd.wait_event(["AP-ENABLED"], timeout=10)
+    if not ev:
+        raise Exception("AP setup timed out")
+
+    state = hapd.get_status_field("state")
+    if state != "ENABLED":
+        raise Exception("Unexpected interface state - expected ENABLED")
+
+    freq = hapd.get_status_field("freq")
+    if freq != "2432":
+        raise Exception("Unexpected frequency: " + freq)
+    pri = hapd.get_status_field("channel")
+    if pri != "5":
+        raise Exception("Unexpected primary channel: " + pri)
+    sec = hapd.get_status_field("secondary_channel")
+    if sec != "0":
+        raise Exception("Unexpected secondary channel: " + sec)
+
+    dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
+
 def test_ap_ht40_scan_match(dev, apdev):
     """HT40 co-ex scan matching configuration"""
     clear_scan_cache(apdev[0]['ifname'])