aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-01-15 17:16:07 (GMT)
committerJouni Malinen <j@w1.fi>2016-01-15 17:34:58 (GMT)
commit5a38a7fe436a3b00367d9f066794b563ff0e2ac7 (patch)
treea470e76dcf0199d15b8ccc46e1904a4ca5e3bcd5 /tests
parent03269d558a08f0b086f7d2b8aafdb49d3315889e (diff)
downloadhostap-5a38a7fe436a3b00367d9f066794b563ff0e2ac7.zip
hostap-5a38a7fe436a3b00367d9f066794b563ff0e2ac7.tar.gz
hostap-5a38a7fe436a3b00367d9f066794b563ff0e2ac7.tar.bz2
tests: Roam between two WPA2-PSK APs and try to hit a disconnection race
This is a regression test case for hostapd bug where the disconnection/deauthentication TX status callback timeout could be forgotten after new association if no ACK frame was received and the STA managed to reconnect within two seconds. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_roam.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_roam.py b/tests/hwsim/test_ap_roam.py
index f41e272..b2b2f1d 100644
--- a/tests/hwsim/test_ap_roam.py
+++ b/tests/hwsim/test_ap_roam.py
@@ -65,3 +65,23 @@ def test_ap_roam_set_bssid(dev, apdev):
dev[0].set_network(id, "bssid", "")
dev[0].set_network(id, "bssid", apdev[0]['bssid'])
dev[0].set_network(id, "bssid", apdev[1]['bssid'])
+
+def test_ap_roam_wpa2_psk_race(dev, apdev):
+ """Roam between two WPA2-PSK APs and try to hit a disconnection race"""
+ params = hostapd.wpa2_params(ssid="test-wpa2-psk", passphrase="12345678")
+ hapd0 = hostapd.add_ap(apdev[0]['ifname'], params)
+ dev[0].connect("test-wpa2-psk", psk="12345678", scan_freq="2412")
+ hwsim_utils.test_connectivity(dev[0], hapd0)
+
+ params['channel'] = '2'
+ hapd1 = hostapd.add_ap(apdev[1]['ifname'], params)
+ dev[0].scan_for_bss(apdev[1]['bssid'], freq=2417)
+ dev[0].roam(apdev[1]['bssid'])
+ hwsim_utils.test_connectivity(dev[0], hapd1)
+ dev[0].roam(apdev[0]['bssid'])
+ hwsim_utils.test_connectivity(dev[0], hapd0)
+ # Wait at least two seconds to trigger the previous issue with the
+ # disconnection callback.
+ for i in range(3):
+ time.sleep(0.8)
+ hwsim_utils.test_connectivity(dev[0], hapd0)