From 99cd77a8c50413d44f1ebead917310468a8406de Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 11 Mar 2014 20:08:18 +0200 Subject: [PATCH] tests: Verify reassociate-to-same-BSS commands Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_roam.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/hwsim/test_ap_roam.py b/tests/hwsim/test_ap_roam.py index 11e209783..6a2467c3e 100644 --- a/tests/hwsim/test_ap_roam.py +++ b/tests/hwsim/test_ap_roam.py @@ -36,3 +36,20 @@ def test_ap_roam_wpa2_psk(dev, apdev): hwsim_utils.test_connectivity(dev[0].ifname, apdev[1]['ifname']) dev[0].roam(apdev[0]['bssid']) hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) + +def test_ap_reassociation_to_same_bss(dev, apdev): + """Reassociate to the same BSS""" + hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-open" }) + dev[0].connect("test-open", key_mgmt="NONE") + + dev[0].request("REASSOCIATE") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Reassociation with the AP timed out") + hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname']) + + dev[0].request("REATTACH") + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=10) + if ev is None: + raise Exception("Reassociation (reattach) with the AP timed out") + hwsim_utils.test_connectivity(dev[0].ifname, apdev[0]['ifname'])