[PATCH 2/2] tests: Add all-blacklist test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Brian Norris <briannorris@xxxxxxxxxxxx>
---
 tests/hwsim/test_ap_roam.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/tests/hwsim/test_ap_roam.py b/tests/hwsim/test_ap_roam.py
index 9047c7a80209..13e669bad01b 100644
--- a/tests/hwsim/test_ap_roam.py
+++ b/tests/hwsim/test_ap_roam.py
@@ -26,6 +26,31 @@ def test_ap_roam_open(dev, apdev):
     dev[0].roam(apdev[0]['bssid'])
     hwsim_utils.test_connectivity(dev[0], hapd0)
 
+def test_ap_blacklist_all(dev, apdev, params):
+    """Ensure we clear the blacklist if all visible APs reject."""
+    hapd0 = hostapd.add_ap(apdev[0], {"ssid": "test-open", "max_num_sta": "0"})
+    hapd1 = hostapd.add_ap(apdev[1], {"ssid": "test-open", "max_num_sta": "0"})
+    bss0 = hapd0.own_addr()
+    bss1 = hapd1.own_addr()
+
+    dev[0].connect("test-open", key_mgmt="NONE", scan_freq="2412",
+                   wait_connect=False, bssid=bss0)
+    if not dev[0].wait_event(["CTRL-EVENT-AUTH-REJECT"], timeout=10):
+        raise Exception("AP 0 didn't reject us")
+    dev[0].connect("test-open", key_mgmt="NONE", scan_freq="2412",
+                   wait_connect=False, bssid=bss1)
+    if not dev[0].wait_event(["CTRL-EVENT-AUTH-REJECT"], timeout=10):
+        raise Exception("AP 1 didn't reject us")
+    blacklist = get_blacklist(dev[0])
+    if len(blacklist) != 2:
+        raise Exception("Unexpected blacklist: %s" % blacklist)
+
+    hapd0.set("max_num_sta", "1")
+    # All visible APs were blacklisted; we should clear the blacklist and find
+    # the AP that now accepts us.
+    dev[0].scan_for_bss(bss0, freq=2412)
+    dev[0].connect("test-open", key_mgmt="NONE", scan_freq="2412", bssid=bss0)
+
 @remote_compatible
 def test_ap_roam_open_failed(dev, apdev):
     """Roam failure due to rejected authentication"""
-- 
2.27.0.278.ge193c7cf3a9-goog


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux