]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: VHT 80 MHz with different HT40 channel options
authorJouni Malinen <j@w1.fi>
Mon, 22 Jun 2015 23:30:24 +0000 (02:30 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 22 Jun 2015 23:30:24 +0000 (02:30 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_vht.py

index d8af46e4abcc6923906e79537e82a075b3892ba6..5a0dde6f4c428bc09c6c11d73abd18092b2b8c53 100644 (file)
@@ -56,6 +56,47 @@ def test_ap_vht80(dev, apdev):
         subprocess.call(['iw', 'reg', 'set', '00'])
         dev[0].flush_scan_cache()
 
+def vht80_test(apdev, dev, channel, ht_capab):
+    try:
+        hapd = None
+        params = { "ssid": "vht",
+                   "country_code": "FI",
+                   "hw_mode": "a",
+                   "channel": str(channel),
+                   "ht_capab": ht_capab,
+                   "ieee80211n": "1",
+                   "ieee80211ac": "1",
+                   "vht_oper_chwidth": "1",
+                   "vht_oper_centr_freq_seg0_idx": "42" }
+        hapd = hostapd.add_ap(apdev['ifname'], params)
+        bssid = apdev['bssid']
+
+        dev.connect("vht", key_mgmt="NONE", scan_freq=str(5000 + 5 * channel))
+        hwsim_utils.test_connectivity(dev, hapd)
+    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.request("DISCONNECT")
+        if hapd:
+            hapd.request("DISABLE")
+        subprocess.call(['iw', 'reg', 'set', '00'])
+        dev.flush_scan_cache()
+
+def test_ap_vht80b(dev, apdev):
+    """VHT with 80 MHz channel width (HT40- channel 40)"""
+    vht80_test(apdev[0], dev[0], 40, "[HT40-]")
+
+def test_ap_vht80c(dev, apdev):
+    """VHT with 80 MHz channel width (HT40+ channel 44)"""
+    vht80_test(apdev[0], dev[0], 44, "[HT40+]")
+
+def test_ap_vht80d(dev, apdev):
+    """VHT with 80 MHz channel width (HT40- channel 48)"""
+    vht80_test(apdev[0], dev[0], 48, "[HT40-]")
+
 def test_ap_vht80_params(dev, apdev):
     """VHT with 80 MHz channel width and number of optional features enabled"""
     try: