tests: Suite B

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-11-16 15:42:29 +02:00
parent 929a2ea5df
commit b652daca84
3 changed files with 42 additions and 0 deletions

View file

@ -72,3 +72,5 @@ CFLAGS += -DALL_DH_GROUPS
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y

View file

@ -114,3 +114,5 @@ CONFIG_WNM=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
CONFIG_SUITEB=y

View file

@ -0,0 +1,38 @@
# Suite B tests
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import time
import logging
logger = logging.getLogger()
import hostapd
def test_suite_b(dev, apdev):
"""WPA2-PSK/GCMP connection"""
if "GCMP" not in dev[0].get_capability("pairwise"):
return "skip"
params = hostapd.wpa2_eap_params(ssid="test-suite-b")
params["wpa_key_mgmt"] = "WPA-EAP-SUITE-B"
params['rsn_pairwise'] = "GCMP"
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
# TODO: Force Suite B configuration for TLS
dev[0].connect("test-suite-b", key_mgmt="WPA-EAP-SUITE-B",
eap="TLS", identity="tls user", ca_cert="auth_serv/ca.pem",
client_cert="auth_serv/user.pem",
private_key="auth_serv/user.key",
pairwise="GCMP", group="GCMP", scan_freq="2412")
dev[0].request("DISCONNECT")
ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=20)
if ev is None:
raise Exception("Disconnection event timed out")
dev[0].dump_monitor()
dev[0].request("RECONNECT")
ev = dev[0].wait_event(["CTRL-EVENT-EAP-STARTED",
"CTRL-EVENT-CONNECTED"], timeout=20)
if ev is None:
raise Exception("Roaming with the AP timed out")
if "CTRL-EVENT-EAP-STARTED" in ev:
raise Exception("Unexpected EAP exchange")