This patch series fixes the following problem:
linux# make kselftest TARGETS=bpf O=/mnt/linux-build
# selftests: bpf: test_libbpf.sh
# ./test_libbpf.sh: line 23: ./test_libbpf_open: No such file or directory
# test_libbpf: failed at file test_l4lb.o
# selftests: test_libbpf [FAILED]
Patch 1 appends / to $(OUTPUT) in order to make it more uniform with the
rest of the tree.
Patch 2 fixes the problem by prepending $(OUTPUT) to all members of
$(TEST_PROGS).
v1->v2:
- Append / to $(OUTPUT).
- …
[View More]Use $(addprefix) instead of $(foreach).
v2->v3:
- Split the patch in two.
- Improve the commit message.
Ilya Leoshkevich (2):
selftests: append / to $(OUTPUT)
selftests: fix prepending $(OUTPUT) to $(TEST_PROGS)
tools/testing/selftests/Makefile | 16 ++++++++--------
tools/testing/selftests/lib.mk | 3 ++-
2 files changed, 10 insertions(+), 9 deletions(-)
--
2.23.0
[View Less]
This patch series simplifies kselftest use-cases and addresses requests
from developers and testers to add support for building and installing
from the main Makefile.
Shuah Khan (2):
Makefile: Add kselftest_build target to build tests
selftests: Add kselftest_install target to main Makefile
Makefile | 8 ++++++++
tools/testing/selftests/Makefile | 8 ++++++--
tools/testing/selftests/kselftest_install.sh | 4 ++--
3 files changed, 16 …
[View More]insertions(+), 4 deletions(-)
--
2.20.1
[View Less]
Hi Linus,
Please pull the following Kselftest update for Linux 5.4-rc1.
This Kselftest update for Linux 5.4-rc1 consists of several fixes to
existing tests.
diff is attached.
This pull has just the ksleftest patches I sent in my previous pull
request. I dropped the KUnit patches and rebased.
I will send another pull request for the KUnit work later on this
week.
Please note that there is conflict between
tools/testing/selftests/tpm2/Makefile
between commit:
3fb2179b0f3553a ("…
[View More]selftests/tpm2: Add the missing TEST_FILES assignment")
from the tpmdd tree and commit:
d04e26067d13f01 ("selftests: tpm2: install python files")
Please take the fix from kselftest tree which is the correct
version for this change.
d04e26067d13f01 ("selftests: tpm2: install python files")
Please let me know if you have any questions and/or concerns.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit d1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1:
Linux 5.3-rc5 (2019-08-18 14:31:08 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-5.4-rc1.1
for you to fetch changes up to 721cb3c8bc8890e824b7be53bf951960ff7811f9:
selftests: tpm2: install python files (2019-09-23 08:33:16 -0600)
----------------------------------------------------------------
linux-kselftest-5.4-rc1.1
This Kselftest update for Linux 5.4-rc1 consists of fixes to existing
tests.
----------------------------------------------------------------
Anders Roxell (2):
selftests: livepatch: add missing fragments to config
selftests: tpm2: install python files
George G. Davis (2):
selftests: watchdog: Add optional file argument
selftests: watchdog: cleanup whitespace in usage options
Ilya Leoshkevich (1):
selftests: use "$(MAKE)" instead of "make"
Masanari Iida (1):
selftest/ftrace: Fix typo in trigger-snapshot.tc
Tycho Andersen (1):
selftests/seccomp: fix build on older kernels
tools/testing/selftests/Makefile | 22 ++++++------
.../ftrace/test.d/trigger/trigger-snapshot.tc | 2 +-
tools/testing/selftests/livepatch/config | 2 ++
tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++
tools/testing/selftests/tpm2/Makefile | 1 +
tools/testing/selftests/watchdog/watchdog-test.c | 41
+++++++++++++++-------
6 files changed, 48 insertions(+), 25 deletions(-)
----------------------------------------------------------------
[View Less]
Hi
so this series carries two small fixes to the toplevel KSelfTest makefile
which I found useful especially while attempting to run the suite in
automation.
[1/2]
While it is already possible to specify a limited list of TARGETS to run,
it is not instead easily possible to state a list of targets NOT to run
(say due to specific instability issues).
Moreover providing such a skip list through a stripped down list of TARGETS
it is cumbersome and fragile since this poses the risk to stick to an …
[View More]old
stale stripped TARGETS list once upstream decides to add more default
targets.
A new SKIP_TARGETS Makefile variable is provided by this patch to easily
specify a skiplist for target subsystems.
[2/2]
Currently when some target fails to build, KSFT Makefile just carries on
building as much subsystems as it can: unfortunately this is not properly
reflected also in the generation of the runlist inside run_kselftest.sh.
This patch rectifies this behaviour checking for the existence of a target
directory in the INSTALL_PATH before adding the related snippet to the
run_kselftest.sh script.
Thanks
Cristian
Changelog
v1 --> v2
- added Documentation
- various typos fixed
- added a proper override when filtering-out SKIP_TARGETS from TARGETS
to make it work also when TARGETS is provided too from the cmdline
Cristian Marussi (2):
kselftest: add capability to skip chosen TARGETS
kselftest: exclude failed TARGETS from runlist
Documentation/dev-tools/kselftest.rst | 11 +++++++++++
tools/testing/selftests/Makefile | 11 +++++++++++
2 files changed, 22 insertions(+)
--
2.17.1
[View Less]
I found a bug in kselftest KBUILD_OUTPUT handling.
The following works:
$ cd /home/tbird/work/linux
$ export KBUILD_OUTPUT=/home/tbird/work/kbuild
$ yes '' | make localmodconfig
$ make TARGETS=size kselftest
But this doesn't work:
$ cd /home/tbird/work/linux
$ export KBUILD_OUTPUT=../kbuild
$ yes '' | make localmodconfig
$ make TARGETS=size kselftest
I see the following:
make[1]: Entering directory '/home/tbird/work/kbuild'
make --no-builtin-rules INSTALL_HDR_PATH=$BUILD/usr \
ARCH=x86 -C …
[View More]../../.. headers_install
INSTALL ../kbuild/kselftest/usr/include
gcc -static -ffreestanding -nostartfiles -s get_size.c -o ../kbuild/kselftest/size/get_size
/usr/bin/ld: cannot open output file ../kbuild/kselftest/size/get_size: No such file or directory
collect2: error: ld returned 1 exit status
../lib.mk:138: recipe for target '../kbuild/kselftest/size/get_size' failed
make[3]: *** [../kbuild/kselftest/size/get_size] Error 1
Makefile:136: recipe for target 'all' failed
make[2]: *** [all] Error 2
/home/tbird/work/linux/Makefile:1240: recipe for target 'kselftest' failed
make[1]: *** [kselftest] Error 2
make[1]: Leaving directory '/home/tbird/work/kbuild'
Makefile:179: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
This is due to the relative path for KBUILD_OUTPUT being handled incorrectly (I believe)
in tools/testing/selftests/Makefile.
There are these lines in the Makefile, which are responsible for creating the output
directory:
BUILD_TARGET=$$BUILD/$$TARGET
mkdir $$BUILD_TARGET -p
But these are executed from working directory tools/testing/selftests,
so the 'size' directory gets created at tools/testing/kbuild/kselftest/size,
instead of /home/tbird/work/kbuild/kselftest/size.
I can add some code to the Makefile to change the assignment of the
variable BUILD, so that if it is a relative path it is relative to $(top_srcdir)
instead of the current directory. But I wanted to check and make sure that
I'm not breaking anyone else's workflow.
I'm not sure what the expectation would be for someone who did this:
$ export KBUILD_OUTPUT=../kbuild ; make -C tools/testing/selftests run_tests
But I assume if someone is running the kernel's 'make' from the top-level
kernel source directory, and they have a relative KBUILD_OUTPUT directory,
then they want that output directory to be relative to the top-level directory
and not somewhere else.
Should I just code up something for review?
I use relative KBUILD_OUTPUT paths for a number of my kernel build scripts,
and right now these are incompatible with kselftests.
Thanks,
-- Tim
[View Less]
Let the user specify an optional TARGETS skiplist through the new optional
SKIP_TARGETS Makefile variable.
It is easier to skip at will a reduced and well defined list of possibly
problematic targets with SKIP_TARGETS then to provide a partially stripped
down list of good targets using the usual TARGETS variable.
Signed-off-by: Cristian Marussi <cristian.marussi(a)arm.com>
---
tools/testing/selftests/Makefile | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/testing/…
[View More]selftests/Makefile b/tools/testing/selftests/Makefile
index 25b43a8c2b15..103936faa46d 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -132,6 +132,10 @@ else
ARCH=$(ARCH) -C $(top_srcdir) headers_install
endif
+# User can optionally provide a TARGETS skiplist.
+SKIP_TARGETS ?=
+TARGETS := $(filter-out $(SKIP_TARGETS), $(TARGETS))
+
all: khdr
@for TARGET in $(TARGETS); do \
BUILD_TARGET=$$BUILD/$$TARGET; \
--
2.17.1
[View Less]
Hi Linus,
Please pull the following Kselftest update for Linux 5.4-rc1 (minus kunit).
This Kselftest update for Linux 5.4-rc1 consists of several fixes to
existing tests.
diff is attached.
This pull has just the ksleftest patches I sent in my previous pull
request. I dropped the KUnit patches and rebased.
I will send another pull request for the KUnit work later on this
week.
Please note that there is conflict between
tools/testing/selftests/tpm2/Makefile
between commit:
…
[View More]3fb2179b0f3553a ("selftests/tpm2: Add the missing TEST_FILES assignment")
from the tpmdd tree and commit:
d04e26067d13f01 ("selftests: tpm2: install python files")
Please take the fix from kselftest tree which is the correct
version for this change.
d04e26067d13f01 ("selftests: tpm2: install python files")
Please let me know if you have any questions and/or concerns.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit d1abaeb3be7b5fa6d7a1fbbd2e14e3310005c4c1:
Linux 5.3-rc5 (2019-08-18 14:31:08 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-5.4-rc1.1
for you to fetch changes up to 721cb3c8bc8890e824b7be53bf951960ff7811f9:
selftests: tpm2: install python files (2019-09-23 08:33:16 -0600)
----------------------------------------------------------------
linux-kselftest-5.4-rc1.1
This Kselftest update for Linux 5.4-rc1 consists of fixes to existing
tests.
----------------------------------------------------------------
Anders Roxell (2):
selftests: livepatch: add missing fragments to config
selftests: tpm2: install python files
George G. Davis (2):
selftests: watchdog: Add optional file argument
selftests: watchdog: cleanup whitespace in usage options
Ilya Leoshkevich (1):
selftests: use "$(MAKE)" instead of "make"
Masanari Iida (1):
selftest/ftrace: Fix typo in trigger-snapshot.tc
Tycho Andersen (1):
selftests/seccomp: fix build on older kernels
tools/testing/selftests/Makefile | 22 ++++++------
.../ftrace/test.d/trigger/trigger-snapshot.tc | 2 +-
tools/testing/selftests/livepatch/config | 2 ++
tools/testing/selftests/seccomp/seccomp_bpf.c | 5 +++
tools/testing/selftests/tpm2/Makefile | 1 +
tools/testing/selftests/watchdog/watchdog-test.c | 41
+++++++++++++++-------
6 files changed, 48 insertions(+), 25 deletions(-)
----------------------------------------------------------------
[View Less]