On Fri, Jun 5, 2020 at 9:03 PM David Gow davidgow@google.com wrote:
From: Patricia Alfonso trishalfonso@google.com
Integrate KASAN into KUnit testing framework. - Fail tests when KASAN reports an error that is not expected - Use KUNIT_EXPECT_KASAN_FAIL to expect a KASAN error in KASAN tests - Expected KASAN reports pass tests and are still printed when run without kunit_tool (kunit_tool still bypasses the report due to the test passing) - KUnit struct in current task used to keep track of the current test from KASAN code
This patch makes use of "kunit: generalize kunit_resource API beyond allocated resources" and "kunit: add support for named resources" from Alan Maguire [1] - A named resource is added to a test when a KASAN report is expected - This resource contains a struct for kasan_data containing booleans representing if a KASAN report is expected and if a KASAN report is found
[1] https://lore.kernel.org/linux-kselftest/CAFd5g46Uu_5TG89uOm0Dj5CMq+11cwjBnsd...
Signed-off-by: Patricia Alfonso trishalfonso@google.com Signed-off-by: David Gow davidgow@google.com Reviewed-by: Dmitry Vyukov dvyukov@google.com Reviewed-by: Andrey Konovalov andreyknvl@google.com
Acked-by: Brendan Higgins brendanhiggins@google.com