tests: Verify FT-over-DS

Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2013-12-28 11:52:19 +02:00
parent 2d2ecf51aa
commit b553eab1a9
2 changed files with 43 additions and 3 deletions

View file

@ -62,7 +62,7 @@ def ft_params2(rsn=True, ssid=None, passphrase=None):
params['r1kh'] = "02:00:00:00:03:00 00:01:02:03:04:05 300102030405060708090a0b0c0d0e0f"
return params
def run_roams(dev, apdev, ssid, passphrase):
def run_roams(dev, apdev, ssid, passphrase, over_ds=False):
logger.info("Connect to first AP")
dev.connect(ssid, psk=passphrase, key_mgmt="FT-PSK", proto="WPA2",
ieee80211w="1")
@ -75,12 +75,18 @@ def run_roams(dev, apdev, ssid, passphrase):
hwsim_utils.test_connectivity(dev.ifname, ap1['ifname'])
logger.info("Roam to the second AP")
if over_ds:
dev.roam_over_ds(ap2['bssid'])
else:
dev.roam(ap2['bssid'])
if dev.get_status_field('bssid') != ap2['bssid']:
raise Exception("Did not connect to correct AP")
hwsim_utils.test_connectivity(dev.ifname, ap2['ifname'])
logger.info("Roam back to the first AP")
if over_ds:
dev.roam_over_ds(ap1['bssid'])
else:
dev.roam(ap1['bssid'])
if dev.get_status_field('bssid') != ap1['bssid']:
raise Exception("Did not connect to correct AP")
@ -123,3 +129,29 @@ def test_ap_ft_pmf(dev, apdev):
hostapd.add_ap(apdev[1]['ifname'], params)
run_roams(dev[0], apdev, ssid, passphrase)
def test_ap_ft_over_ds(dev, apdev):
"""WPA2-PSK-FT AP over DS"""
ssid = "test-ft"
passphrase="12345678"
params = ft_params1(ssid=ssid, passphrase=passphrase)
hostapd.add_ap(apdev[0]['ifname'], params)
params = ft_params2(ssid=ssid, passphrase=passphrase)
hostapd.add_ap(apdev[1]['ifname'], params)
run_roams(dev[0], apdev, ssid, passphrase, over_ds=True)
def test_ap_ft_pmf_over_ds(dev, apdev):
"""WPA2-PSK-FT AP over DS with PMF"""
ssid = "test-ft"
passphrase="12345678"
params = ft_params1(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
hostapd.add_ap(apdev[0]['ifname'], params)
params = ft_params2(ssid=ssid, passphrase=passphrase)
params["ieee80211w"] = "2";
hostapd.add_ap(apdev[1]['ifname'], params)
run_roams(dev[0], apdev, ssid, passphrase, over_ds=True)

View file

@ -608,6 +608,14 @@ class WpaSupplicant:
raise Exception("Roaming with the AP timed out")
self.dump_monitor()
def roam_over_ds(self, bssid):
self.dump_monitor()
self.request("FT_DS " + bssid)
ev = self.wait_event(["CTRL-EVENT-CONNECTED"], timeout=10)
if ev is None:
raise Exception("Roaming with the AP timed out")
self.dump_monitor()
def wps_reg(self, bssid, pin, new_ssid=None, key_mgmt=None, cipher=None,
new_passphrase=None):
self.dump_monitor()