This test first configure hsotapd with an initial SSID ('test-wpa2-psk-start'). Then a new SSID is configured ('test-wpa2-psk-new') using SET and RELOAD. Next, a station is associated using WPS, and the test verifies that the new SSID was served to the station. Signed-off-by: Raphaël Mélotte <raphael.melotte@xxxxxxx> --- tests/hwsim/test_ap_dynamic.py | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 96d35b9a2..ff03080f4 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -37,6 +37,42 @@ def test_ap_change_ssid(dev, apdev): dev[0].set_network_quoted(id, "ssid", "test-wpa2-psk-new") dev[0].connect_network(id) +def test_ap_change_ssid_wps(dev, apdev): + """Dynamic SSID change with hostapd and WPA2-PSK using WPS""" + params = hostapd.wpa2_params(ssid="test-wpa2-psk-start", + passphrase="12345678") + # Use a psk and not the passphrase, because the psk will have to be computed again + # if we use a passphrase: + del params["wpa_passphrase"] + params["wpa_psk"] = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef" + + params.update({"wps_state": "2", "eap_server": "1"}) + bssid = apdev[0]['bssid'] + hapd = hostapd.add_ap(apdev[0], params) + + new_ssid = "test-wpa2-psk-new" + logger.info("Change SSID dynamically (WPS)") + res = hapd.request("SET ssid " + new_ssid) + if "OK" not in res: + raise Exception("SET command failed") + res = hapd.request("RELOAD") + if "OK" not in res: + raise Exception("RELOAD command failed") + + # Connect to the new ssid using wps: + hapd.request("WPS_PBC") + if "PBC Status: Active" not in hapd.request("WPS_GET_STATUS"): + raise Exception("PBC status not shown correctly") + + dev[0].request("WPS_PBC") + dev[0].wait_connected(timeout=20) + status = dev[0].get_status() + if status['wpa_state'] != 'COMPLETED' or status['bssid'] != bssid: + raise Exception("Not fully connected") + if status['ssid'] != new_ssid: + raise Exception("Unexpected SSID %s != %s" % (status['ssid'], new_ssid)) + dev[0].request("DISCONNECT") + def multi_check(apdev, dev, check, scan_opt=True): id = [] num_bss = len(check) -- 2.29.2 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap