From 10ea684830420b167c434002f421c32bbf44363e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 28 Dec 2013 17:21:41 +0200 Subject: [PATCH] tests: Verify WPS extensibility (version and new attribute) Signed-hostap: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index dcab574f3..3324f720f 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -377,3 +377,41 @@ def test_ap_wps_fragmentation(dev, apdev): raise Exception("Unexpected encryption configuration") if status['key_mgmt'] != 'WPA2-PSK': raise Exception("Unexpected key_mgmt") + +def test_ap_wps_new_version_sta(dev, apdev): + """WPS compatibility with new version number on the station""" + ssid = "test-wps-ver" + hostapd.add_ap(apdev[0]['ifname'], + { "ssid": ssid, "eap_server": "1", "wps_state": "2", + "wpa_passphrase": "12345678", "wpa": "2", + "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" }) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + logger.info("WPS provisioning step") + hapd.request("WPS_PBC") + dev[0].request("SET ignore_old_scan_res 1") + dev[0].dump_monitor() + dev[0].request("SET wps_version_number 0x43") + dev[0].request("WPS_PBC") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30) + if ev is None: + raise Exception("Association with the AP timed out") + +def test_ap_wps_new_version_ap(dev, apdev): + """WPS compatibility with new version number on the AP""" + ssid = "test-wps-ver" + hostapd.add_ap(apdev[0]['ifname'], + { "ssid": ssid, "eap_server": "1", "wps_state": "2", + "wpa_passphrase": "12345678", "wpa": "2", + "wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" }) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + logger.info("WPS provisioning step") + if "FAIL" in hapd.request("SET wps_version_number 0x43"): + raise Exception("Failed to enable test functionality") + hapd.request("WPS_PBC") + dev[0].request("SET ignore_old_scan_res 1") + dev[0].dump_monitor() + dev[0].request("WPS_PBC") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=30) + hapd.request("SET wps_version_number 0x20") + if ev is None: + raise Exception("Association with the AP timed out")