]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: HT40 co-ex scan conflict (HT40-)
authorJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 08:23:35 +0000 (11:23 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 23 Jun 2015 08:25:22 +0000 (11:25 +0300)
This verifies a case where the neighboring BSS is at the other end of
the band and has its PRI channel further away.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_ht.py

index f9d83c83bae17bf7b6ad0496a0ae9e8210fbe798..e6895c55c28c3ac471b6168a10aa734aa7000d6a 100644 (file)
@@ -96,6 +96,46 @@ def test_ap_ht40_scan_conflict(dev, apdev):
 
     dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)
 
+def test_ap_ht40_scan_conflict2(dev, apdev):
+    """HT40 co-ex scan conflict (HT40-)"""
+    clear_scan_cache(apdev[0]['ifname'])
+    params = { "ssid": "test-ht40",
+               "channel": "11",
+               "ht_capab": "[HT40-]"}
+    hostapd.add_ap(apdev[1]['ifname'], params)
+
+    params = { "ssid": "test-ht40",
+               "channel": "1",
+               "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 != "2412":
+        raise Exception("Unexpected frequency")
+    pri = hapd.get_status_field("channel")
+    if pri != "1":
+        raise Exception("Unexpected primary channel")
+    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_not_affected(dev, apdev):
     """HT40 co-ex scan and other BSS not affected"""
     clear_scan_cache(apdev[0]['ifname'])