Add backtrace-based error path testing mechanism
authorJouni Malinen <j@w1.fi>
Sun, 28 Jun 2015 18:35:43 +0000 (21:35 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 29 Jun 2015 20:23:56 +0000 (23:23 +0300)
commit2da525651d9aa49854bff51f7e4faf9273f68868
treecc4f9c4f170df82c3c404891df38ccbcb5f5a539
parent0937ea746bceb3d98c9fe0d4461e228d9d904221
Add backtrace-based error path testing mechanism

The new TEST_FAIL and GET_FAIL control interface commands can be used
similarly to the earlier TEST_ALLOC_FAIL/GET_ALLOC_FAIL design. The new
version is more generic framework allowing any function to be annotated
for failure testing with the TEST_FAIL() macro. This mechanism is only
available in builds with CONFIG_WPA_TRACE_BFD=y and
CONFIG_TESTING_OPTIONS=y. For other builds, the TEST_FAIL() macro is
defined to return 0 to allow the compiler to remove the test code from
normal production builds.

As the first test site, allow os_get_random() to be marked for failing
based on call backtrace.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/ctrl_iface.c
src/utils/os.h
src/utils/os_unix.c
wpa_supplicant/ctrl_iface.c