diff --git a/tests/hwsim/test_connect_cmd.py b/tests/hwsim/test_connect_cmd.py index 3c0985137..d101ee705 100644 --- a/tests/hwsim/test_connect_cmd.py +++ b/tests/hwsim/test_connect_cmd.py @@ -191,6 +191,25 @@ def test_connect_cmd_roam(dev, apdev): wpas.wait_disconnected() wpas.dump_monitor() +def test_connect_cmd_wpa_psk_roam(dev, apdev): + """WPA2/WPA-PSK connection using cfg80211 connect command to trigger roam""" + params = hostapd.wpa2_params(ssid="sta-connect", passphrase="12345678") + hostapd.add_ap(apdev[0], params) + + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add("wlan5", drv_params="force_connect_cmd=1") + wpas.connect("sta-connect", psk="12345678", scan_freq="2412") + wpas.dump_monitor() + + params = hostapd.wpa_params(ssid="sta-connect", passphrase="12345678") + hostapd.add_ap(apdev[1], params) + wpas.scan_for_bss(apdev[1]['bssid'], freq=2412, force_scan=True) + wpas.roam(apdev[1]['bssid']) + time.sleep(0.1) + wpas.request("DISCONNECT") + wpas.wait_disconnected() + wpas.dump_monitor() + def test_connect_cmd_bssid_hint(dev, apdev): """cfg80211 connect command with bssid_hint""" params = {"ssid": "sta-connect"}