aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/driver_i.h
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-01-19 17:34:00 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-19 17:34:00 (GMT)
commit911942ee646606f44d16b97afed674369fb76c4f (patch)
treed7d5bdc6d9ce0d85941979b4d26f141a9d0a6776 /wpa_supplicant/driver_i.h
parente60be3b3d4afa94fe9bd61b73be0442071bb44b8 (diff)
downloadhostap-911942ee646606f44d16b97afed674369fb76c4f.zip
hostap-911942ee646606f44d16b97afed674369fb76c4f.tar.gz
hostap-911942ee646606f44d16b97afed674369fb76c4f.tar.bz2
Add a test framework for various wpa_supplicant failure cases
For CONFIG_TESTING_OPTIONS=y builds, add a new test parameter than can be used to trigger various error cases within wpa_supplicant operations to make it easier to test error path processing. "SET test_failure <val>" is used to set which operation fails. For now, 0 = no failures and 1 = scan trigger fails with EBUSY. More operations can be added in the future to extend coverage. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/driver_i.h')
-rw-r--r--wpa_supplicant/driver_i.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 8dc48d3..9debcf8 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -90,6 +90,10 @@ static inline int wpa_drv_leave_mesh(struct wpa_supplicant *wpa_s)
static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s,
struct wpa_driver_scan_params *params)
{
+#ifdef CONFIG_TESTING_OPTIONS
+ if (wpa_s->test_failure == WPAS_TEST_FAILURE_SCAN_TRIGGER)
+ return -EBUSY;
+#endif /* CONFIG_TESTING_OPTIONS */
if (wpa_s->driver->scan2)
return wpa_s->driver->scan2(wpa_s->drv_priv, params);
return -1;