Message ID | 20201008122633.687877-1-tommi.t.rantala@nokia.com |
---|---|
Headers | show |
Series | selftests fixes | expand |
On Thu, Oct 08, 2020 at 03:26:21PM +0300, Tommi Rantala wrote: > Commit 1056d3d2c97e ("selftests: enforce local header dependency in > lib.mk") added header dependency to the rule, but as the rule uses $^, > the headers are added to the compiler command line. > > This can cause unexpected precompiled header files being generated when > compilation fails: > > $ echo { >> openat2_test.c > > $ make > gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined openat2_test.c > tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c > -o tools/testing/selftests/openat2/openat2_test > openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token > 313 | { > | ^ > make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1 > > $ file openat2_test* > openat2_test: GCC precompiled header (version 014) for C > openat2_test.c: C source, ASCII text > > Fix it by filtering out the headers, so that we'll only pass the actual > *.c files in the compiler command line. > > Fixes: 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Ah yes, thanks! Acked-by: Kees Cook <keescook@chromium.org> -- Kees Cook
On Thu, Oct 08, 2020 at 03:26:23PM +0300, Tommi Rantala wrote: > Commit 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") > added vmaccess testcase, add the binary to .gitignore > > Fixes: 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Reviewed-by: Kees Cook <keescook@chromium.org>
On Thu, Oct 08, 2020 at 03:26:32PM +0300, Tommi Rantala wrote: > XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL > into SKIP"), use SKIP instead. > > Fixes: 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Reviewed-by: Kees Cook <keescook@chromium.org> -- Kees Cook
On Thu, Oct 08, 2020 at 03:26:33PM +0300, Tommi Rantala wrote: > XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL > into SKIP"), use SKIP instead. > > Fixes: 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> Reviewed-by: Kees Cook <keescook@chromium.org>
On Thu, Oct 08, 2020 at 03:26:33PM +0300, Tommi Rantala wrote: > XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL > into SKIP"), use SKIP instead. > > Fixes: 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Thanks! Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:32PM +0300, Tommi Rantala wrote: > XFAIL is gone since 9847d24af95c ("selftests/harness: Refactor XFAIL > into SKIP"), use SKIP instead. > > Fixes: 9847d24af95c ("selftests/harness: Refactor XFAIL into SKIP") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Thanks! Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:23PM +0300, Tommi Rantala wrote: > Commit 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") > added vmaccess testcase, add the binary to .gitignore > > Fixes: 2de4e82318c7 ("selftests/ptrace: add test cases for dead-locks") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Thanks! Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:25PM +0300, Tommi Rantala wrote: > There's planned tests != run tests in pidfd_test when some test is > skipped: > > $ ./pidfd_test > TAP version 13 > 1..8 > [...] > # pidfd_send_signal signal recycled pid test: Skipping test > # Planned tests != run tests (8 != 7) > # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:0 error:0 > > Fix by using ksft_test_result_skip(): > > $ ./pidfd_test > TAP version 13 > 1..8 > [...] > ok 8 # SKIP pidfd_send_signal signal recycled pid test: Unsharing pid namespace not permitted > # Totals: pass:7 fail:0 xfail:0 xpass:0 skip:1 error:0 > > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Thanks, I never got around to fixing this myself. Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:26PM +0300, Tommi Rantala wrote: > Skip test if kcmp() is not available, for example if kernel is compiled > without CONFIG_CHECKPOINT_RESTORE=y. > > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Good catch, thanks! Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:29PM +0300, Tommi Rantala wrote: > Fix multiple definition of sock_name compilation error: > > tools/testing/selftests/android/ion/ipcsocket.h:8: multiple definition of `sock_name' > > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Ion will be removed from the kernel soon but this seems like an ok bugfix. Thanks! Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:21PM +0300, Tommi Rantala wrote: > Commit 1056d3d2c97e ("selftests: enforce local header dependency in > lib.mk") added header dependency to the rule, but as the rule uses $^, > the headers are added to the compiler command line. > > This can cause unexpected precompiled header files being generated when > compilation fails: > > $ echo { >> openat2_test.c > > $ make > gcc -Wall -O2 -g -fsanitize=address -fsanitize=undefined openat2_test.c > tools/testing/selftests/kselftest_harness.h tools/testing/selftests/kselftest.h helpers.c > -o tools/testing/selftests/openat2/openat2_test > openat2_test.c:313:1: error: expected identifier or ‘(’ before ‘{’ token > 313 | { > | ^ > make: *** [../lib.mk:140: tools/testing/selftests/openat2/openat2_test] Error 1 > > $ file openat2_test* > openat2_test: GCC precompiled header (version 014) for C > openat2_test.c: C source, ASCII text > > Fix it by filtering out the headers, so that we'll only pass the actual > *.c files in the compiler command line. > > Fixes: 1056d3d2c97e ("selftests: enforce local header dependency in lib.mk") > Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> > --- Thanks! Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
On Thu, Oct 08, 2020 at 03:26:20PM +0300, Tommi Rantala wrote: > Hi, small fixes to issues I hit with selftests. > > Tommi Rantala (13): > selftests: filter kselftest headers from command in lib.mk > selftests: pidfd: fix compilation errors due to wait.h > selftests: add vmaccess to .gitignore > selftests/harness: prettify SKIP message whitespace again > selftests: pidfd: use ksft_test_result_skip() when skipping test > selftests: pidfd: skip test on kcmp() ENOSYS > selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config > selftests: pidfd: drop needless linux/kcmp.h inclusion in > pidfd_setns_test.c > selftests: android: fix multiple definition of sock_name > selftests: proc: fix warning: _GNU_SOURCE redefined > selftests: core: use SKIP instead of XFAIL in close_range_test.c > selftests: clone3: use SKIP instead of XFAIL > selftests: binderfs: use SKIP instead of XFAIL This mostly deals with stuff I maintain but it can go via the selftest tree, thanks! Christian
On 10/8/20 6:26 AM, Tommi Rantala wrote: > Hi, small fixes to issues I hit with selftests. > > Tommi Rantala (13): > selftests: filter kselftest headers from command in lib.mk > selftests: pidfd: fix compilation errors due to wait.h > selftests: add vmaccess to .gitignore > selftests/harness: prettify SKIP message whitespace again > selftests: pidfd: use ksft_test_result_skip() when skipping test > selftests: pidfd: skip test on kcmp() ENOSYS > selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config > selftests: pidfd: drop needless linux/kcmp.h inclusion in > pidfd_setns_test.c > selftests: android: fix multiple definition of sock_name > selftests: proc: fix warning: _GNU_SOURCE redefined > selftests: core: use SKIP instead of XFAIL in close_range_test.c > selftests: clone3: use SKIP instead of XFAIL > selftests: binderfs: use SKIP instead of XFAIL > > tools/testing/selftests/android/ion/ipcsocket.c | 1 + > tools/testing/selftests/android/ion/ipcsocket.h | 2 -- > .../selftests/clone3/clone3_cap_checkpoint_restore.c | 2 +- > tools/testing/selftests/core/close_range_test.c | 8 ++++---- > .../selftests/filesystems/binderfs/binderfs_test.c | 8 ++++---- > tools/testing/selftests/kselftest_harness.h | 2 +- > tools/testing/selftests/lib.mk | 2 +- > tools/testing/selftests/pidfd/config | 1 + > tools/testing/selftests/pidfd/pidfd_getfd_test.c | 5 ++++- > tools/testing/selftests/pidfd/pidfd_open_test.c | 1 - > tools/testing/selftests/pidfd/pidfd_poll_test.c | 1 - > tools/testing/selftests/pidfd/pidfd_setns_test.c | 1 - > tools/testing/selftests/pidfd/pidfd_test.c | 2 +- > tools/testing/selftests/proc/proc-loadavg-001.c | 1 - > tools/testing/selftests/proc/proc-self-syscall.c | 1 - > tools/testing/selftests/proc/proc-uptime-002.c | 1 - > tools/testing/selftests/ptrace/.gitignore | 1 + > 17 files changed, 19 insertions(+), 21 deletions(-) > Thanks for fixing these. Applied all except 03/13 which is already fixed. thanks, -- Shuah
Tommi Rantala <tommi.t.rantala@nokia.com> writes: > Hi, small fixes to issues I hit with selftests. > > Tommi Rantala (13): > selftests: filter kselftest headers from command in lib.mk > selftests: pidfd: fix compilation errors due to wait.h > selftests: add vmaccess to .gitignore > selftests/harness: prettify SKIP message whitespace again > selftests: pidfd: use ksft_test_result_skip() when skipping test > selftests: pidfd: skip test on kcmp() ENOSYS > selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config > selftests: pidfd: drop needless linux/kcmp.h inclusion in > pidfd_setns_test.c > selftests: android: fix multiple definition of sock_name > selftests: proc: fix warning: _GNU_SOURCE redefined > selftests: core: use SKIP instead of XFAIL in close_range_test.c > selftests: clone3: use SKIP instead of XFAIL > selftests: binderfs: use SKIP instead of XFAIL This series doesn't seem to have been picked up? cheers
On 10/27/20 7:37 PM, Michael Ellerman wrote: > Tommi Rantala <tommi.t.rantala@nokia.com> writes: >> Hi, small fixes to issues I hit with selftests. >> >> Tommi Rantala (13): >> selftests: filter kselftest headers from command in lib.mk >> selftests: pidfd: fix compilation errors due to wait.h >> selftests: add vmaccess to .gitignore >> selftests/harness: prettify SKIP message whitespace again >> selftests: pidfd: use ksft_test_result_skip() when skipping test >> selftests: pidfd: skip test on kcmp() ENOSYS >> selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config >> selftests: pidfd: drop needless linux/kcmp.h inclusion in >> pidfd_setns_test.c >> selftests: android: fix multiple definition of sock_name >> selftests: proc: fix warning: _GNU_SOURCE redefined >> selftests: core: use SKIP instead of XFAIL in close_range_test.c >> selftests: clone3: use SKIP instead of XFAIL >> selftests: binderfs: use SKIP instead of XFAIL > > This series doesn't seem to have been picked up? > > cheers > I applied them to linux-kselftest fixes yesterday. thanks, -- Shuah
Shuah Khan <skhan@linuxfoundation.org> writes: > On 10/27/20 7:37 PM, Michael Ellerman wrote: >> Tommi Rantala <tommi.t.rantala@nokia.com> writes: >>> Hi, small fixes to issues I hit with selftests. >>> >>> Tommi Rantala (13): >>> selftests: filter kselftest headers from command in lib.mk >>> selftests: pidfd: fix compilation errors due to wait.h >>> selftests: add vmaccess to .gitignore >>> selftests/harness: prettify SKIP message whitespace again >>> selftests: pidfd: use ksft_test_result_skip() when skipping test >>> selftests: pidfd: skip test on kcmp() ENOSYS >>> selftests: pidfd: add CONFIG_CHECKPOINT_RESTORE=y to config >>> selftests: pidfd: drop needless linux/kcmp.h inclusion in >>> pidfd_setns_test.c >>> selftests: android: fix multiple definition of sock_name >>> selftests: proc: fix warning: _GNU_SOURCE redefined >>> selftests: core: use SKIP instead of XFAIL in close_range_test.c >>> selftests: clone3: use SKIP instead of XFAIL >>> selftests: binderfs: use SKIP instead of XFAIL >> >> This series doesn't seem to have been picked up? >> > > I applied them to linux-kselftest fixes yesterday. Thanks. cheers
On 10/9/20 6:05 AM, Christian Brauner wrote: > On Thu, Oct 08, 2020 at 03:26:29PM +0300, Tommi Rantala wrote: >> Fix multiple definition of sock_name compilation error: >> >> tools/testing/selftests/android/ion/ipcsocket.h:8: multiple definition of `sock_name' >> >> Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com> >> --- > > Ion will be removed from the kernel soon but this seems like an ok > bugfix. > Thanks! > Acked-by: Christian Brauner <christian.brauner@ubuntu.com> > ion is already gone. I am dropping this from linux-kselftest fixes now. This is also causing conflict with ion removal commit thanks, -- Shuah