1. Fail roaming to an AP which exceeded its number of allowed stations. 2. Fail roaming due to passphrase mismatch. Signed-off-by: Ilan Peer <ilan.peer@xxxxxxxxx> --- tests/hwsim/test_ap_roam.py | 57 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/hwsim/test_ap_roam.py b/tests/hwsim/test_ap_roam.py index fdf99ae..20f4bd8 100644 --- a/tests/hwsim/test_ap_roam.py +++ b/tests/hwsim/test_ap_roam.py @@ -24,6 +24,28 @@ def test_ap_roam_open(dev, apdev): dev[0].roam(apdev[0]['bssid']) hwsim_utils.test_connectivity(dev[0], hapd0) +def test_ap_roam_open_failed(dev, apdev): + """Roam failure due to rejected authentication""" + hapd0 = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-open" }) + dev[0].connect("test-open", key_mgmt="NONE") + hwsim_utils.test_connectivity(dev[0], hapd0) + hapd1 = hostapd.add_ap(apdev[1]['ifname'], { "ssid": "test-open", "max_num_sta" : "0" }) + + dev[0].scan(type="ONLY") + dev[0].dump_monitor() + if "OK" not in dev[0].request("ROAM " + apdev[1]['bssid']): + raise Exception("ROAM failed") + + ev = dev[0].wait_event(["CTRL-EVENT-AUTH-REJECT"], 1) + if not ev: + raise Exception("CTRL-EVENT-AUTH-REJECT was not seen"); + + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], 5) + if not ev: + raise Exception("CTRL-EVENT-CONNECTED was not seen"); + + hwsim_utils.test_connectivity(dev[0], hapd0) + def test_ap_roam_wpa2_psk(dev, apdev): """Roam between two WPA2-PSK APs""" params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678") @@ -37,6 +59,41 @@ def test_ap_roam_wpa2_psk(dev, apdev): dev[0].roam(apdev[0]['bssid']) hwsim_utils.test_connectivity(dev[0], hapd0) +def test_ap_roam_wpa2_psk_failed(dev, apdev, params): + """Roam failure with WPA2-PSK AP due to wrong passphrase""" + + params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678") + hapd0 = hostapd.add_ap(apdev[0]['ifname'], params) + id = dev[0].connect("test-wpa2-psk", psk="12345678") + hwsim_utils.test_connectivity(dev[0], hapd0) + params['wpa_passphrase'] = "22345678" + hapd1 = hostapd.add_ap(apdev[1]['ifname'], params) + dev[0].scan(type="ONLY", freq=2412) + + dev[0].dump_monitor() + if "OK" not in dev[0].request("ROAM " + apdev[1]['bssid']): + raise Exception("ROAM failed") + + ev = dev[0].wait_event(["CTRL-EVENT-SSID-TEMP-DISABLED", + "CTRL-EVENT-CONNECTED"], 5) + if "CTRL-EVENT-CONNECTED" in ev: + raise Exception("Got unexpected CTRL-EVENT-CONNECTED") + if "CTRL-EVENT-SSID-TEMP-DISABLED" not in ev: + raise Exception("CTRL-EVENT-SSID-TEMP-DISABLED not seen") + + if "OK" not in dev[0].request("SELECT_NETWORK id=" + str(id)): + raise Exception("SELECT_NETWORK failed") + + ev = dev[0].wait_event(["CTRL-EVENT-SSID-REENABLED"], 3) + if not ev: + raise Exception("CTRL-EVENT-SSID-REENABLED not seen"); + + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], 5) + if not ev: + raise Exception("CTRL-EVENT-CONNECTED not seen"); + + hwsim_utils.test_connectivity(dev[0], hapd0) + def test_ap_reassociation_to_same_bss(dev, apdev): """Reassociate to the same BSS""" hapd = hostapd.add_ap(apdev[0], { "ssid": "test-open" }) -- 1.9.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap