From 30a67736dc7a2ff9594619384ac13b946669c366 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 16 Oct 2018 00:51:21 +0300 Subject: [PATCH] tests: VHT with 80 MHz channel width reconfigured to 2.4 GHz HT Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_vht.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py index c9f299f22..2f898071b 100644 --- a/tests/hwsim/test_ap_vht.py +++ b/tests/hwsim/test_ap_vht.py @@ -1064,3 +1064,41 @@ def test_ap_vht_40_fallback_to_20(devs, apdevs): hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) dev.flush_scan_cache() + +def test_ap_vht80_to_24g_ht(dev, apdev): + """VHT with 80 MHz channel width reconfigured to 2.4 GHz HT""" + try: + hapd = None + params = { "ssid": "vht", + "country_code": "FI", + "hw_mode": "a", + "channel": "36", + "ht_capab": "[HT40+]", + "ieee80211n": "1", + "ieee80211ac": "1", + "vht_oper_chwidth": "1", + "vht_capab": "[MAX-MPDU-11454]", + "vht_oper_centr_freq_seg0_idx": "42" } + hapd = hostapd.add_ap(apdev[0], params) + bssid = apdev[0]['bssid'] + + hapd.disable() + hapd.set("ieee80211ac", "0") + hapd.set("hw_mode", "g") + hapd.set("channel", "1") + hapd.set("ht_capab", "") + hapd.set("vht_capab", "") + hapd.enable() + + dev[0].connect("vht", key_mgmt="NONE", scan_freq="2412") + except Exception, e: + if isinstance(e, Exception) and str(e) == "AP startup failed": + if not vht_supported(): + raise HwsimSkip("80 MHz channel not supported in regulatory information") + raise + finally: + dev[0].request("DISCONNECT") + if hapd: + hapd.request("DISABLE") + subprocess.call(['iw', 'reg', 'set', '00']) + dev[0].flush_scan_cache()