Browse Source

tests: Verify HT/VHT required rejection

Previously, only the case of STA supporting HT/VHT was tested. Now both
cases are verified.

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
145f35bf30

+ 2 - 1
tests/hwsim/example-wpa_supplicant.config

@@ -91,7 +91,8 @@ CONFIG_NO_RANDOM_POOL=y
 CONFIG_TLSV11=y
 CONFIG_TLSV12=y
 
-#CONFIG_HT_OVERRIDES=y
+CONFIG_HT_OVERRIDES=y
+CONFIG_VHT_OVERRIDES=y
 
 CONFIG_DEBUG_LINUX_TRACING=y
 

+ 7 - 0
tests/hwsim/test_ap_ht.py

@@ -332,4 +332,11 @@ def test_ap_require_ht(dev, apdev):
                "require_ht": "1" }
     hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False)
 
+    dev[1].connect("require-ht", key_mgmt="NONE", scan_freq="2412",
+                   disable_ht="1", wait_connect=False)
     dev[0].connect("require-ht", key_mgmt="NONE", scan_freq="2412")
+    ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+    if ev is None:
+        raise Exception("Association rejection timed out")
+    if "status_code=27" not in ev:
+        raise Exception("Unexpected rejection status code")

+ 8 - 0
tests/hwsim/test_ap_vht.py

@@ -60,7 +60,15 @@ def test_ap_vht80_params(dev, apdev):
                    "require_vht": "1" }
         hapd = hostapd.add_ap(apdev[0]['ifname'], params)
 
+        dev[1].connect("vht", key_mgmt="NONE", scan_freq="5180",
+                       disable_vht="1", wait_connect=False)
         dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
+        ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
+        if ev is None:
+            raise Exception("Association rejection timed out")
+        if "status_code=104" not in ev:
+            raise Exception("Unexpected rejection status code")
+        dev[1].request("DISCONNECT")
         hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
     except Exception, e:
         if isinstance(e, Exception) and str(e) == "AP startup failed":

+ 1 - 1
tests/hwsim/wpasupplicant.py

@@ -631,7 +631,7 @@ class WpaSupplicant:
         not_quoted = [ "proto", "key_mgmt", "ieee80211w", "pairwise",
                        "group", "wep_key0", "scan_freq", "eap",
                        "eapol_flags", "fragment_size", "scan_ssid", "auth_alg",
-                       "wpa_ptk_rekey" ]
+                       "wpa_ptk_rekey", "disable_ht", "disable_vht" ]
         for field in not_quoted:
             if field in kwargs and kwargs[field]:
                 self.set_network(id, field, kwargs[field])