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(). BUG=chromium:1040974, chromium:1051374 TEST=emerge and deploy hostap-test for Betty board on a cros_vm instance `tast -verbose run -var=network.HostapHwsim.runArgs='-f module_tests' localhost:9222 network.HostapHwsim.full` Signed-off-by: Kevin Lund <kglund@xxxxxxxxxx> Change-Id: I237c6d83e68cbd7298d239a8be520ab4d09c3618 --- 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.761.g0e0b3e54be-goog _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap