aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2013-04-04 14:50:25 (GMT)
committerJouni Malinen <j@w1.fi>2013-04-27 19:15:06 (GMT)
commit590160d502cfda6bee216d37181359c6a6f153b7 (patch)
tree395039f9f6e9217f0ea86514a664bfb1ff178cab
parentfe904963d0b029a398abd62aeacf5ad5b54ca821 (diff)
downloadhostap-590160d502cfda6bee216d37181359c6a6f153b7.zip
hostap-590160d502cfda6bee216d37181359c6a6f153b7.tar.gz
hostap-590160d502cfda6bee216d37181359c6a6f153b7.tar.bz2
tests: Add a test case for AP auto configuration on config token build
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_nfc_wps.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/hwsim/test_nfc_wps.py b/tests/hwsim/test_nfc_wps.py
index abbdd52..9d5b2a4 100644
--- a/tests/hwsim/test_nfc_wps.py
+++ b/tests/hwsim/test_nfc_wps.py
@@ -77,6 +77,26 @@ def test_nfc_wps_config_token(dev, apdev):
raise Exception("Association with the AP timed out")
check_wpa2_connection(dev[0], apdev[0], ssid)
+def test_nfc_wps_config_token_init(dev, apdev):
+ """NFC tag with configuration token from AP with auto configuration"""
+ dev[0].request("SET ignore_old_scan_res 1")
+ ssid = "test-wps-nfc-conf-token-init"
+ hostapd.add_ap(apdev[0]['ifname'],
+ { "ssid": ssid, "eap_server": "1", "wps_state": "1" })
+ hapd = hostapd.Hostapd(apdev[0]['ifname'])
+ logger.info("NFC configuration token from AP to station")
+ conf = hapd.request("WPS_NFC_CONFIG_TOKEN NDEF").rstrip()
+ if "FAIL" in conf:
+ raise Exception("Failed to generate configuration token")
+ dev[0].dump_monitor()
+ res = dev[0].request("WPS_NFC_TAG_READ " + conf)
+ if "FAIL" in res:
+ raise Exception("Failed to provide NFC tag contents to wpa_supplicant")
+ ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
+ if ev is None:
+ raise Exception("Association with the AP timed out")
+ check_wpa2_connection(dev[0], apdev[0], ssid, mixed=True)
+
def test_nfc_wps_password_token_sta_init(dev, apdev):
"""Initial AP configuration with first WPS NFC Enrollee"""
dev[0].request("SET ignore_old_scan_res 1")