selftests: Enhance kselftest_harness.h to print which assert failed
authorMickaël Salaün <mic@digikod.net>
Sun, 6 Aug 2017 23:23:37 +0000 (01:23 +0200)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 6 Sep 2017 01:21:33 +0000 (19:21 -0600)
commit369130b63178e0e2f863a2da2a5ad0238ded6d9d
tree84a336c9a26fdb68b45a788d5fa9371028a73278
parent1f87c7c15d77350c4ab1c14d9ab8df2a1f1010d1
selftests: Enhance kselftest_harness.h to print which assert failed

When a test process is not able to write to TH_LOG_STREAM, this step
mechanism enable to print the assert number which triggered the failure.
This can be enabled by setting _metadata->no_print to true at the
beginning of the test sequence.

Update the seccomp-bpf test to return 0 if a test succeeded.

This feature is needed for the Landlock tests.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Will Drewry <wad@chromium.org>
Link: https://lkml.kernel.org/r/CAGXu5j+D-FP8Kt9unNOqKrQJP4DYTpmgkJxWykZyrYiVPz3Y3Q@mail.gmail.com
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/kselftest_harness.h
tools/testing/selftests/seccomp/seccomp_bpf.c