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>
This commit is contained in:
Jouni Malinen 2014-03-23 19:49:12 +02:00
parent a4e510fefd
commit 145f35bf30
4 changed files with 18 additions and 2 deletions

View file

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

View file

@ -332,4 +332,11 @@ def test_ap_require_ht(dev, apdev):
"require_ht": "1" } "require_ht": "1" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params, wait_enabled=False) 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") 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")

View file

@ -60,7 +60,15 @@ def test_ap_vht80_params(dev, apdev):
"require_vht": "1" } "require_vht": "1" }
hapd = hostapd.add_ap(apdev[0]['ifname'], params) 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") 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']) hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])
except Exception, e: except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed": if isinstance(e, Exception) and str(e) == "AP startup failed":

View file

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