]>
git.ipfire.org Git - thirdparty/hostap.git/blob - tests/hwsim/test_ap_roam.py
4 # Copyright (c) 2013, Jouni Malinen <j@w1.fi>
6 # This software may be distributed under the terms of the BSD license.
7 # See README for more details.
12 logger
= logging
.getLogger(__name__
)
17 def test_ap_roam_open(dev
, apdev
):
18 """Roam between two open APs"""
19 hostapd
.add_ap(apdev
[0]['ifname'], { "ssid": "test-open" })
20 dev
[0].connect("test-open", key_mgmt
="NONE")
21 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[0]['ifname'])
22 hostapd
.add_ap(apdev
[1]['ifname'], { "ssid": "test-open" })
23 dev
[0].scan(type="ONLY")
24 dev
[0].roam(apdev
[1]['bssid'])
25 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[1]['ifname'])
26 dev
[0].roam(apdev
[0]['bssid'])
27 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[0]['ifname'])
29 def test_ap_roam_wpa2_psk(dev
, apdev
):
30 """Roam between two WPA2-PSK APs"""
31 params
= hostapd
.wpa2_params(ssid
="test-wpa2-psk", passphrase
="12345678")
32 hostapd
.add_ap(apdev
[0]['ifname'], params
)
33 dev
[0].connect("test-wpa2-psk", psk
="12345678")
34 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[0]['ifname'])
35 hostapd
.add_ap(apdev
[1]['ifname'], params
)
36 dev
[0].scan(type="ONLY")
37 dev
[0].roam(apdev
[1]['bssid'])
38 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[1]['ifname'])
39 dev
[0].roam(apdev
[0]['bssid'])
40 hwsim_utils
.test_connectivity(dev
[0].ifname
, apdev
[0]['ifname'])