From 61af1e6618b19fe5f0834c2a14525e03f7eafed1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 29 Apr 2017 14:11:17 +0300 Subject: [PATCH] tests: HT40 with both plus and minus allowed Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_ht.py | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index 31bd8ff35..911168d04 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -1328,3 +1328,43 @@ def test_ap_ht_op_class_126(dev, apdev): def test_ap_ht_op_class_127(dev, apdev): """HT40 on operationg class 127""" run_op_class(dev, apdev, "a", "153", "US", "[HT40-]", "-1", "5765", 127) + +def test_ap_ht40_plus_minus1(dev, apdev): + """HT40 with both plus and minus allowed (1)""" + clear_scan_cache(apdev[0]) + params = { "ssid": "test-ht40", + "channel": "11", + "ht_capab": "[HT40+][HT40-]"} + hapd = hostapd.add_ap(apdev[0], params) + + freq = hapd.get_status_field("freq") + if freq != "2462": + raise Exception("Unexpected frequency: " + freq) + pri = hapd.get_status_field("channel") + if pri != "11": + raise Exception("Unexpected primary channel: " + pri) + sec = hapd.get_status_field("secondary_channel") + if sec != "-1": + raise Exception("Unexpected secondary channel: " + sec) + + dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq) + +def test_ap_ht40_plus_minus2(dev, apdev): + """HT40 with both plus and minus allowed (2)""" + clear_scan_cache(apdev[0]) + params = { "ssid": "test-ht40", + "channel": "1", + "ht_capab": "[HT40+][HT40-]"} + hapd = hostapd.add_ap(apdev[0], params) + + freq = hapd.get_status_field("freq") + if freq != "2412": + raise Exception("Unexpected frequency: " + freq) + pri = hapd.get_status_field("channel") + if pri != "1": + raise Exception("Unexpected primary channel: " + pri) + sec = hapd.get_status_field("secondary_channel") + if sec != "1": + raise Exception("Unexpected secondary channel: " + sec) + + dev[0].connect("test-ht40", key_mgmt="NONE", scan_freq=freq)