]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify HT/VHT required rejection
authorJouni Malinen <j@w1.fi>
Sun, 23 Mar 2014 17:49:12 +0000 (19:49 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Mar 2014 17:49:12 +0000 (19:49 +0200)
Previously, only the case of STA supporting HT/VHT was tested. Now both
cases are verified.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/example-wpa_supplicant.config
tests/hwsim/test_ap_ht.py
tests/hwsim/test_ap_vht.py
tests/hwsim/wpasupplicant.py

index c603baa84912c9da335ba43bcba83122850a862d..d43799e124ef0728938e2b1306ebc5f3cf5ed016 100644 (file)
@@ -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
 
index fa95c2b833f8c7b5e2b481d8c6d6ebc7fbb71bb9..030c71b8ca5be165f8176986a18d52dbcd279462 100644 (file)
@@ -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")
index 2df003f9b5a4a2d08247c13c455b6a07d7a65ba6..c198d9b0a60d7bab2165803a48f9c34c95553dfb 100644 (file)
@@ -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":
index 8732f195a37a60c9288e80b269e374936c2ca0bb..49ab9cc5add2610b61a1f0f8bde037ca67028897 100644 (file)
@@ -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])