[PATCH v3 4/5] wpa_supplicant: Add new blacklist tests

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

 



From: Kevin Lund <kglund@xxxxxxxxxx>

This change adds some barebones tests for new blacklisting functionality
to wpas_module_tests.c. The tests ensure some basic functionality for
the functions wpa_blacklist_is_blacklisted() and wpa_blacklist_update().

Signed-off-by: Kevin Lund <kglund@xxxxxxxxxx>
Signed-off-by: Brian Norris <briannorris@xxxxxxxxxxxx>
---
v3:
- rebased (refactored patch 2/5 to fit with new scan_res_ok() function)
- added patch to clear blacklist on config changes
---
 wpa_supplicant/wpas_module_tests.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/wpa_supplicant/wpas_module_tests.c b/wpa_supplicant/wpas_module_tests.c
index 4e37591be..1c136f782 100644
--- a/wpa_supplicant/wpas_module_tests.c
+++ b/wpa_supplicant/wpas_module_tests.c
@@ -59,6 +59,23 @@ static int wpas_blacklist_module_tests(void)
 	    wpa_blacklist_add(&wpa_s, (u8 *) "333333") < 0)
 		goto fail;
 
+	wpa_blacklist_clear(&wpa_s);
+
+	if (wpa_blacklist_add(&wpa_s, (u8 *) "111111") < 0 ||
+	    wpa_blacklist_add(&wpa_s, (u8 *) "222222") < 0 ||
+	    wpa_blacklist_add(&wpa_s, (u8 *) "333333") < 0 ||
+	    wpa_blacklist_add(&wpa_s, (u8 *) "444444") < 0 ||
+	    !wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111") ||
+	    wpa_blacklist_del(&wpa_s, (u8 *) "111111") < 0 ||
+	    wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111") ||
+	    wpa_blacklist_add(&wpa_s, (u8 *) "111111") < 0)
+		goto fail;
+
+	wpa_blacklist_update(&wpa_s);
+
+	if (!wpa_blacklist_is_blacklisted(&wpa_s, (u8 *) "111111"))
+		goto fail;
+
 	ret = 0;
 fail:
 	wpa_blacklist_clear(&wpa_s);
-- 
2.26.2


_______________________________________________
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