[PATCH 6/6] tests: flush scan results before checking alloc failure

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

 



When run after other tests, It was likely that the target
bss was already present in scan_fail, so the
scan_for_bss() wouldn't trip the allocation failure in
wpa_bss_add(). Flush the scan results before the scan to
ensure wpa_bss_add() is called and consistently pass
scan_fail.

Signed-off-by: Thomas Pedersen <thomas@xxxxxxxxxxxx>
---
 tests/hwsim/test_scan.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py
index 9bf7a0fd4ebd..aac07eea6fa6 100644
--- a/tests/hwsim/test_scan.py
+++ b/tests/hwsim/test_scan.py
@@ -1166,6 +1166,7 @@ def test_scan_fail(dev, apdev):
 
     hapd = hostapd.add_ap(apdev[0], {"ssid": "open"})
     with alloc_fail(dev[0], 1, "wpa_bss_add"):
+        dev[0].flush_scan_cache()
         dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
 
 def test_scan_fail_type_only(dev, apdev):
-- 
2.20.1


_______________________________________________
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