aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-11-16 13:42:29 (GMT)
committerJouni Malinen <j@w1.fi>2014-11-16 15:09:11 (GMT)
commitb652daca84601cd82ea4014a3e0693187811effc (patch)
treed75705749ab80b296ac62e872dcaea6c5a21fc12 /tests
parent929a2ea5df7a56c83a84cdea96a56c9be220329d (diff)
downloadhostap-b652daca84601cd82ea4014a3e0693187811effc.zip
hostap-b652daca84601cd82ea4014a3e0693187811effc.tar.gz
hostap-b652daca84601cd82ea4014a3e0693187811effc.tar.bz2
tests: Suite B
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/example-hostapd.config2
-rw-r--r--tests/hwsim/example-wpa_supplicant.config2
-rw-r--r--tests/hwsim/test_suite_b.py38
3 files changed, 42 insertions, 0 deletions
diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config
index 40e594c..5acb0ce 100644
--- a/tests/hwsim/example-hostapd.config
+++ b/tests/hwsim/example-hostapd.config
@@ -72,3 +72,5 @@ CFLAGS += -DALL_DH_GROUPS
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
+
+CONFIG_SUITEB=y
diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config
index a39b74d..ed68724 100644
--- a/tests/hwsim/example-wpa_supplicant.config
+++ b/tests/hwsim/example-wpa_supplicant.config
@@ -114,3 +114,5 @@ CONFIG_WNM=y
CONFIG_TESTING_OPTIONS=y
CONFIG_MODULE_TESTS=y
+
+CONFIG_SUITEB=y
diff --git a/tests/hwsim/test_suite_b.py b/tests/hwsim/test_suite_b.py
new file mode 100644
index 0000000..dec9eb7
--- /dev/null
+++ b/tests/hwsim/test_suite_b.py
@@ -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")