kselftest install target feature
Subsystems (9)
v2 cover kselftest install target feature
This patch series adds a new kselftest_install make target to enable selftest install. When make kselftest_install is run, selftests are installed on the system. A new install target is added to selftests Makefile which will install targets for the tests that are specified in INSTALL_TARGETS. During install, a script is generated to run tests that are installed. This script will be installed in the selftest install directory. Individual test Makefiles are changed to add to the script. This will allow new tests to add install and run test commands to the generated kselftest script. kselftest target now depends on kselftest_install and runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.
This v2 series addresses the duplicate code in install and run_tests targets in individual test Makefiles.
Reference: https://lkml.org/lkml/2014/11/4/707
Dropped the following patch from the series since it has been Acked and I queued it up for 3.19-rc1.
selftests/net: move test out of Makefile into a shell script
Reference: https://lkml.org/lkml/2014/11/4/794
Approach:
make kselftest_target:
-- exports kselftest INSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path for ksefltest.sh
-- runs selftests make install target:
selftests make install target
-- creates kselftest.sh script in install install dir
-- runs install targets for all INSTALL_TARGETS
(Note: ftrace and powerpc aren't included in INSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.
Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to the ksefltest.sh file to add commands to run test -- install target can be run only from top level source dir.
Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directory
Maintains the following ways to run tests:
-- make -C tools/testing/selftests run_tests
-- make -C tools/testing/selftests TARGETS=target run_tests
Ability specify targets: e.g TARGETS=net
-- make run_tests from tools/testing/selftests
-- make run_tests from individual test directories:
e.g: make run_tests in tools/testing/selftests/breakpoints
Shuah Khan (19):
selftests/user: move test out of Makefile into a shell script
kbuild: kselftest_install - add a new make target to install selftests
selftests: add install target to enable installing selftests selftests/breakpoints: add install target to enable installing test selftests/cpu-hotplug: add install target to enable installing test selftests/efivarfs: add install target to enable installing test selftests/firmware: add install target to enable installing test selftests/ipc: add install target to enable installing test selftests/kcmp: add install target to enable installing test selftests/memfd: add install target to enable installing test selftests/memory-hotplug: add install target to enable installing test selftests/mount: add install target to enable installing test selftests/mqueue: add install target to enable installing test selftests/net: add install target to enable installing test selftests/ptrace: add install target to enable installing test selftests/sysctl: add install target to enable installing test selftests/timers: add install target to enable installing test selftests/vm: add install target to enable installing test selftests/user: add install target to enable installing test
Makefile | 21 +- tools/testing/selftests/Makefile | 31 ++- tools/testing/selftests/breakpoints/Makefile | 22 +- tools/testing/selftests/cpu-hotplug/Makefile | 17 +- .../selftests/cpu-hotplug/cpu-on-off-test.sh | 269 +++++++++++++++++++++ tools/testing/selftests/cpu-hotplug/on-off-test.sh | 269 --------------------- tools/testing/selftests/efivarfs/Makefile | 19 +- tools/testing/selftests/firmware/Makefile | 49 ++-- tools/testing/selftests/ipc/Makefile | 22 +- tools/testing/selftests/kcmp/Makefile | 22 +- tools/testing/selftests/memfd/Makefile | 20 +- tools/testing/selftests/memory-hotplug/Makefile | 17 +- .../selftests/memory-hotplug/mem-on-off-test.sh | 238 ++++++++++++++++++ .../selftests/memory-hotplug/on-off-test.sh | 238 ------------------ tools/testing/selftests/mount/Makefile | 15 +- tools/testing/selftests/mqueue/Makefile | 20 +- tools/testing/selftests/net/Makefile | 23 +- tools/testing/selftests/ptrace/Makefile | 19 +- tools/testing/selftests/sysctl/Makefile | 23 +- tools/testing/selftests/timers/Makefile | 15 +- tools/testing/selftests/user/Makefile | 21 +- tools/testing/selftests/user/test_user_copy.sh | 10 + tools/testing/selftests/vm/Makefile | 14 +- 23 files changed, 853 insertions(+), 561 deletions(-) create mode 100644 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh delete mode 100644 tools/testing/selftests/cpu-hotplug/on-off-test.sh create mode 100644 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh delete mode 100644 tools/testing/selftests/memory-hotplug/on-off-test.sh create mode 100755 tools/testing/selftests/user/test_user_copy.sh
Signature · 1 line
1.9.1
PATCH v2 1/19 selftests/user: move test out of Makefile into a shell script
Currently user copy test is run from the Makefile. Move it out of the Makefile to be run from a shell script to allow the test to be run as stand-alone test, in addition to allowing the test run from a make target.
--- tools/testing/selftests/user/Makefile | 8 +------- tools/testing/selftests/user/test_user_copy.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100755 tools/testing/selftests/user/test_user_copy.sh
tools/testing/selftests/user/Makefile +1 -7
@@ -4,10 +4,4 @@ all: run_tests: all - @if /sbin/modprobe test_user_copy ; then \ - rmmod test_user_copy; \ - echo "user_copy: ok"; \ - else \ - echo "user_copy: [FAIL]"; \ - exit 1; \ - fi + ./test_user_copy.sh
tools/testing/selftests/user/test_user_copy.sh new file +10 -0
@@ -0,0 +1,10 @@ +#!/bin/sh +# Runs copy_to/from_user infrastructure using test_user_copy kernel module + +if /sbin/modprobe -q test_user_copy; then + /sbin/modprobe -q -r test_user_copy + echo "user_copy: ok" +else + echo "user_copy: [FAIL]" + exit 1 +fi
Signature · 1 line
1.9.1
PATCH v2 2/19 kbuild: kselftest_install - add a new make target to install selftests
In reply to Shuah KhanAdd a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on kselftest_install and runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.
Approach:
make kselftest_target:
-- exports kselftest INSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path for ksefltest.sh
-- runs selftests make install target:
selftests make install target
-- creates kselftest.sh script in install install dir
-- runs install targets for all INSTALL_TARGETS
(Note: ftrace and powerpc aren't included in INSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.
Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to the ksefltest.sh file to add commands to run test -- install target can be run only from top level source dir.
Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directory
Maintains the following ways to run tests:
-- make -C tools/testing/selftests run_tests
-- make -C tools/testing/selftests TARGETS=target run_tests
Ability specify targets: e.g TARGETS=net
-- make run_tests from tools/testing/selftests
-- make run_tests from individual test directories:
e.g: make run_tests in tools/testing/selftests/breakpoints
--- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
Makefile +19 -2
@@ -1071,12 +1071,26 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1 # --------------------------------------------------------------------------- -# Kernel selftest +# Kernel selftest targets + +PHONY += __kselftest_configure +INSTALL_KSFT_PATH=$(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) +export INSTALL_KSFT_PATH +KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh +export KSELFTEST PHONY += kselftest -kselftest: +kselftest: kselftest_install $(Q)$(MAKE) -C tools/testing/selftests run_tests +# Kernel selftest install + +PHONY += kselftest_install +kselftest_install: __kselftest_configure + @rm -rf $(INSTALL_KSFT_PATH) + @mkdir -p $(INSTALL_KSFT_PATH) + $(Q)$(MAKE) -C tools/testing/selftests install + # --------------------------------------------------------------------------- # Modules
@@ -1285,6 +1299,9 @@ help: @echo ' Build, install, and boot kernel before' @echo ' running kselftest on it' @echo '' + @echo ' kselftest_install - Install Kselftests to INSTALL_KSFT_PATH' + @echo ' default: $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)' + @echo '' @echo 'Kernel packaging:' @$(MAKE) $(build)=$(package-dir) help @echo ''
Signature · 1 line
1.9.1
PATCH v2 3/19 selftests: add install target to enable installing selftests
In reply to Shuah KhanAdd a new make target to enable installing selftests. This new target will call install targets for the tests that are specified in INSTALL_TARGETS. During install, a script is generated to run tests that are installed. This script will be installed in the selftest install directory. Individual test Makefiles are changed to add to the script. This will allow new tests to add install and run test commands to the generated kselftest script. run_tests target runs the generated kselftest script to run tests when it is initiated from from "make kselftest" from top level source directory.
Approach:
make kselftest_target:
-- exports kselftest INSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path for ksefltest.sh
-- runs selftests make install target:
selftests make install target
-- creates kselftest.sh script in install install dir
-- runs install targets for all INSTALL_TARGETS
(Note: ftrace and powerpc aren't included in INSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.
Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to the ksefltest.sh file to add commands to run test -- install target can be run only from top level source dir.
Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directory
Maintains the following ways to run tests:
-- make -C tools/testing/selftests run_tests
-- make -C tools/testing/selftests TARGETS=target run_tests
Ability specify targets: e.g TARGETS=net
-- make run_tests from tools/testing/selftests
-- make run_tests from individual test directories:
e.g: make run_tests in tools/testing/selftests/breakpoints
--- tools/testing/selftests/Makefile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)
tools/testing/selftests/Makefile +30 -1
@@ -16,6 +16,10 @@ TARGETS += sysctl TARGETS += firmware TARGETS += ftrace +INSTALL_TARGETS = breakpoints cpu-hotplug efivarfs firmware ipc +INSTALL_TARGETS += kcmp memfd memory-hotplug mqueue mount net +INSTALL_TARGETS += ptrace sysctl timers user vm + TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug
@@ -24,10 +28,35 @@ all: make -C $$TARGET; \ done; -run_tests: all +install: +ifdef INSTALL_KSFT_PATH + make all + @echo #!/bin/sh\n# Kselftest Run Tests .... >> $(KSELFTEST) + @echo # This file is generated during kselftest_install >> $(KSELFTEST) + @echo # Please don't change it !!\n >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) + for TARGET in $(INSTALL_TARGETS); do \ + echo Installing $$TARGET; \ + make -C $$TARGET install; \ + done; + chmod +x $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: +ifdef INSTALL_KSFT_PATH + @cd $(INSTALL_KSFT_PATH); ./kselftest.sh; cd - +# TODO: include ftrace and powerpc in install targets + for TARGET in ftrace powerpc; do \ + make -C $$TARGET run_tests; \ + done; +else + make all for TARGET in $(TARGETS); do \ make -C $$TARGET run_tests; \ done; +endif hotplug: for TARGET in $(TARGETS_HOTPLUG); do \
Signature · 1 line
1.9.1
PATCH v2 4/19 selftests/breakpoints: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/breakpoints/Makefile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-)
tools/testing/selftests/breakpoints/Makefile +20 -2
@@ -8,6 +8,7 @@ ifeq ($(ARCH),x86_64) ARCH := x86 endif +TEST_STR = ./breakpoint_test || echo breakpoints selftests: [FAIL] all: ifeq ($(ARCH),x86)
@@ -16,8 +17,25 @@ else echo "Not an x86 target, can't build breakpoints selftests" endif -run_tests: - @./breakpoint_test || echo "breakpoints selftests: [FAIL]" +install: +ifdef INSTALL_KSFT_PATH +ifeq ($(ARCH),x86) + install ./breakpoint_test $(INSTALL_KSFT_PATH) + @echo echo Start breakpoints test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End breakpoints test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Not an x86 target, unable to install breakpoints selftests +endif +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: all +ifeq ($(ARCH),x86) + @$(TEST_STR) +endif clean: rm -fr breakpoint_test
Signature · 1 line
1.9.1
PATCH v2 5/19 selftests/cpu-hotplug: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/cpu-hotplug/Makefile | 17 +- .../selftests/cpu-hotplug/cpu-on-off-test.sh | 269 +++++++++++++++++++++ tools/testing/selftests/cpu-hotplug/on-off-test.sh | 269 --------------------- 3 files changed, 284 insertions(+), 271 deletions(-) create mode 100644 tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh delete mode 100644 tools/testing/selftests/cpu-hotplug/on-off-test.sh
tools/testing/selftests/cpu-hotplug/Makefile +15 -2
@@ -1,9 +1,22 @@ +TEST_STR=/bin/bash ./cpu-on-off-test.sh || echo cpu-hotplug selftests: [FAIL] + all: +install: +ifdef INSTALL_KSFT_PATH + install ./cpu-on-off-test.sh $(INSTALL_KSFT_PATH)/cpu-on-off-test.sh + @echo echo Start cpu hotplug test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End cpu hotplug test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: - @/bin/bash ./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" + @$(TEST_STR) run_full_test: - @/bin/bash ./on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]" + @/bin/bash ./cpu-on-off-test.sh -a || echo "cpu-hotplug selftests: [FAIL]" clean:
tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh new file +269 -0
269 lines not on this page · raw message
tools/testing/selftests/cpu-hotplug/on-off-test.sh deleted +0 -269
269 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 6/19 selftests/efivarfs: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/efivarfs/Makefile | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
tools/testing/selftests/efivarfs/Makefile +17 -2
@@ -3,10 +3,25 @@ CFLAGS = -Wall test_objs = open-unlink create-read -all: $(test_objs) +TEST_STR = /bin/bash ./efivarfs.sh || echo efivarfs selftests: [FAIL] + +all: + gcc open-unlink.c -o open-unlink + gcc create-read.c -o create-read + +install: +ifdef INSTALL_KSFT_PATH + install ./efivarfs.sh $(test_objs) $(INSTALL_KSFT_PATH) + @echo echo Start efivarfs test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End efivarfs test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif run_tests: all - @/bin/bash ./efivarfs.sh || echo "efivarfs selftests: [FAIL]" + @$(TEST_STR) clean: rm -f $(test_objs)
Signature · 1 line
1.9.1
PATCH v2 7/19 selftests/firmware: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/firmware/Makefile | 49 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 17 deletions(-)
tools/testing/selftests/firmware/Makefile +32 -17
@@ -1,25 +1,40 @@ # Makefile for firmware loading selftests # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" + +__fw_filesystem: +fw_filesystem = if /bin/sh ./fw_filesystem.sh ; then +fw_filesystem += echo fw_filesystem: ok; +fw_filesystem += else echo fw_filesystem: [FAIL]; +fw_filesystem += fi + +__fw_userhelper: +fw_userhelper = if /bin/sh ./fw_userhelper.sh ; then +fw_userhelper += echo fw_userhelper: ok; +fw_userhelper += else +fw_userhelper += echo fw_userhelper: [FAIL]; +fw_userhelper += fi + all: -fw_filesystem: - @if /bin/sh ./fw_filesystem.sh ; then \ - echo "fw_filesystem: ok"; \ - else \ - echo "fw_filesystem: [FAIL]"; \ - exit 1; \ - fi - -fw_userhelper: - @if /bin/sh ./fw_userhelper.sh ; then \ - echo "fw_userhelper: ok"; \ - else \ - echo "fw_userhelper: [FAIL]"; \ - exit 1; \ - fi - -run_tests: all fw_filesystem fw_userhelper +install: +ifdef INSTALL_KSFT_PATH + install ./fw_filesystem.sh ./fw_userhelper.sh $(INSTALL_KSFT_PATH) + @echo echo Start firmware filesystem test .... >> $(KSELFTEST) + @echo "$(fw_filesystem)" >> $(KSELFTEST) + @echo echo End firmware filesystem test .... >> $(KSELFTEST) + @echo echo -------------------- >> $(KSELFTEST) + @echo echo Start firmware userhelper test .... >> $(KSELFTEST) + @echo "$(fw_userhelper)" >> $(KSELFTEST) + @echo echo End firmware userhelper test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: + @$(fw_filesystem) + @$(fw_userhelper) # Nothing to clean up. clean:
Signature · 1 line
1.9.1
PATCH v2 8/19 selftests/ipc: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/ipc/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
tools/testing/selftests/ipc/Makefile +21 -1
@@ -11,6 +11,8 @@ endif CFLAGS += -I../../../../usr/include/ +TEST_STR = ./msgque_test || echo ipc msgque test: [FAIL] + all: ifeq ($(ARCH),x86) gcc $(CFLAGS) msgque.c -o msgque_test
@@ -18,8 +20,26 @@ else echo "Not an x86 target, can't build msgque selftest" endif +install: +ifdef INSTALL_KSFT_PATH +ifeq ($(ARCH),x86) + make all + install ./msgque_test $(INSTALL_KSFT_PATH) + @echo echo Start ipc msgque test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End msgque test .... >> $(KSELFTEST) + @echo "echo ============================== >> $(KSELFTEST) +else + @echo Not an x86 target, unable to install ipc msgque selftests +endif +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - ./msgque_test +ifeq ($(ARCH),x86) + @$(TEST_STR) +endif clean: rm -fr ./msgque_test
Signature · 1 line
1.9.1
PATCH v2 9/19 selftests/kcmp: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/kcmp/Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
tools/testing/selftests/kcmp/Makefile +21 -1
@@ -14,6 +14,8 @@ CFLAGS += -I../../../../include/ CFLAGS += -I../../../../usr/include/ CFLAGS += -I../../../../arch/x86/include/ +TEST_STR = ./kcmp_test || echo kcmp_test: [FAIL] + all: ifeq ($(ARCH),x86) gcc $(CFLAGS) kcmp_test.c -o kcmp_test
@@ -21,8 +23,26 @@ else echo "Not an x86 target, can't build kcmp selftest" endif +install: +ifdef INSTALL_KSFT_PATH +ifeq ($(ARCH),x86) + install ./kcmp_test $(INSTALL_KSFT_PATH) + @echo echo Start kcmp test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo rm -f kcmp-test-file >> $(KSELFTEST) + @echo echo End kcmp test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Not an x86 target, unable install kcmp selftests +endif +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - @./kcmp_test || echo "kcmp_test: [FAIL]" +ifeq ($(ARCH),x86) + @$(TEST_STR) +endif clean: $(RM) kcmp_test kcmp-test-file
Signature · 1 line
1.9.1
PATCH v2 10/19 selftests/memfd: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/memfd/Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
tools/testing/selftests/memfd/Makefile +17 -3
@@ -2,19 +2,33 @@ CFLAGS += -D_FILE_OFFSET_BITS=64 CFLAGS += -I../../../../include/uapi/ CFLAGS += -I../../../../include/ +INSTALL_PROGS = memfd_test fuse_test run_fuse_test.sh +MEMFD_TEST_STR = ./memfd_test || echo memfd_test: [FAIL] +FUSE_TEST_STR = ./run_fuse_test.sh || echo fuse_test: [FAIL] + all: gcc $(CFLAGS) memfd_test.c -o memfd_test +install: +ifdef INSTALL_KSFT_PATH + install $(INSTALL_PROGS) $(INSTALL_KSFT_PATH) + @echo echo Start memfd test .... >> $(KSELFTEST) + @echo "$(MEMFD_TEST_STR)" >> $(KSELFTEST) + @echo echo End memfd test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - gcc $(CFLAGS) memfd_test.c -o memfd_test - @./memfd_test || echo "memfd_test: [FAIL]" + @$(MEMFD_TEST_STR) build_fuse: gcc $(CFLAGS) fuse_mnt.c `pkg-config fuse --cflags --libs` -o fuse_mnt gcc $(CFLAGS) fuse_test.c -o fuse_test run_fuse: build_fuse - @./run_fuse_test.sh || echo "fuse_test: [FAIL]" + @$(FUSE_TEST_STR) clean: $(RM) memfd_test fuse_test
Signature · 1 line
1.9.1
PATCH v2 11/19 selftests/memory-hotplug: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/memory-hotplug/Makefile | 17 +- .../selftests/memory-hotplug/mem-on-off-test.sh | 238 +++++++++++++++++++++ .../selftests/memory-hotplug/on-off-test.sh | 238 --------------------- 3 files changed, 253 insertions(+), 240 deletions(-) create mode 100644 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh delete mode 100644 tools/testing/selftests/memory-hotplug/on-off-test.sh
tools/testing/selftests/memory-hotplug/Makefile +15 -2
@@ -1,9 +1,22 @@ +TEST_STR=/bin/bash ./mem-on-off-test.sh -r 2 || echo memory-hotplug selftests: [FAIL] + all: +install: +ifdef INSTALL_KSFT_PATH + install ./mem-on-off-test.sh $(INSTALL_KSFT_PATH)/mem-on-off-test.sh + @echo echo Start memory hotplug test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) >> $(KSELFTEST) + @echo echo End memory hotplug test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: - @/bin/bash ./on-off-test.sh -r 2 || echo "memory-hotplug selftests: [FAIL]" + @$(TEST_STR) run_full_test: - @/bin/bash ./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" + @/bin/bash ./mem-on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" clean:
tools/testing/selftests/memory-hotplug/mem-on-off-test.sh new file +238 -0
238 lines not on this page · raw message
tools/testing/selftests/memory-hotplug/on-off-test.sh deleted +0 -238
238 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v2 12/19 selftests/mount: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/mount/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tools/testing/selftests/mount/Makefile +14 -1
@@ -1,5 +1,7 @@ # Makefile for mount selftests. +TEST_STR = if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi + all: unprivileged-remount-test unprivileged-remount-test: unprivileged-remount-test.c
@@ -7,7 +9,18 @@ unprivileged-remount-test: unprivileged-remount-test.c # Allow specific tests to be selected. test_unprivileged_remount: unprivileged-remount-test - @if [ -f /proc/self/uid_map ] ; then ./unprivileged-remount-test ; fi + @$(TEST_STR) + +install: +ifdef INSTALL_KSFT_PATH + install ./unprivileged-remount-test $(INSTALL_KSFT_PATH) + @echo echo Start mount test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End mount test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif run_tests: all test_unprivileged_remount
Signature · 1 line
1.9.1
PATCH v2 13/19 selftests/mqueue: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/mqueue/Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
tools/testing/selftests/mqueue/Makefile +17 -3
@@ -1,10 +1,24 @@ +MQ_OPEN_TEST_STR = ./mq_open_tests /test1 || echo mq_open_tests: [FAIL] +MQ_PERF_TEST_STR = ./mq_perf_tests || echo mq_perf_tests: [FAIL] + all: gcc -O2 mq_open_tests.c -o mq_open_tests -lrt gcc -O2 -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt -run_tests: - @./mq_open_tests /test1 || echo "mq_open_tests: [FAIL]" - @./mq_perf_tests || echo "mq_perf_tests: [FAIL]" +install: +ifdef INSTALL_KSFT_PATH + install ./mq_open_tests ./mq_perf_tests $(INSTALL_KSFT_PATH) + @echo echo Start mqueue test .... >> $(KSELFTEST) + @echo "$(MQ_OPEN_TEST_STR)" >> $(KSELFTEST) + @echo "$(MQ_PERF_TEST_STR)" >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: all + @$(MQ_OPEN_TEST_STR) + @$(MQ_PERF_TEST_STR) clean: rm -f mq_open_tests mq_perf_tests
Signature · 1 line
1.9.1
PATCH v2 14/19 selftests/net: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/net/Makefile | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
tools/testing/selftests/net/Makefile +20 -3
@@ -6,14 +6,31 @@ CFLAGS = -Wall -O2 -g CFLAGS += -I../../../../usr/include/ NET_PROGS = socket psock_fanout psock_tpacket +INSTALL_PROGS = run_netsocktests run_afpackettests test_bpf.sh $(NET_PROGS) +NETSOCK_TEST_STR = /bin/sh ./run_netsocktests || echo sockettests: [FAIL] +AFPKT_TEST_STR = /bin/sh ./run_afpackettests || echo afpackettests: [FAIL] +BFP_TEST_STR = ./test_bpf.sh all: $(NET_PROGS) %: %.c $(CC) $(CFLAGS) -o $@ $^ +install: +ifdef INSTALL_KSFT_PATH + install $(INSTALL_PROGS) $(INSTALL_KSFT_PATH) + @echo echo Start net test .... >> $(KSELFTEST) + @echo "$(NETSOCK_TEST_STR)" >> $(KSELFTEST) + @echo "$(AFPKT_TEST_STR)" >> $(KSELFTEST) + @echo "$(BFP_TEST_STR)" >> $(KSELFTEST) + @echo echo End net test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - @/bin/sh ./run_netsocktests || echo "sockettests: [FAIL]" - @/bin/sh ./run_afpackettests || echo "afpackettests: [FAIL]" - ./test_bpf.sh + @$(NETSOCK_TEST_STR) + @$(AFPKT_TEST_STR) + @$(BFP_TEST_STR) clean: $(RM) $(NET_PROGS)
Signature · 1 line
1.9.1
PATCH v2 15/19 selftests/ptrace: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/ptrace/Makefile | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
tools/testing/selftests/ptrace/Makefile +16 -3
@@ -1,10 +1,23 @@ CFLAGS += -iquote../../../../include/uapi -Wall -peeksiginfo: peeksiginfo.c -all: peeksiginfo +TEST_STR = ./peeksiginfo || echo peeksiginfo selftests: [FAIL] + +all: + gcc peeksiginfo.c -o peeksiginfo + +install: +ifdef INSTALL_KSFT_PATH + install ./peeksiginfo $(INSTALL_KSFT_PATH) + @echo echo Start ptrace test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End ptrace test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif clean: rm -f peeksiginfo run_tests: all - @./peeksiginfo || echo "peeksiginfo selftests: [FAIL]" + @$(TEST_STR)
Signature · 1 line
1.9.1
PATCH v2 16/19 selftests/sysctl: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/sysctl/Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
tools/testing/selftests/sysctl/Makefile +21 -2
@@ -4,12 +4,31 @@ # No binaries, but make sure arg-less "make" doesn't trigger "run_tests". all: +INSTALL_PROGS = common_tests run_numerictests run_stringtests +NUMERIC_TEST_STR = /bin/sh ./run_numerictests +STRING_TEST_STR = /bin/sh ./run_stringtests + # Allow specific tests to be selected. test_num: - @/bin/sh ./run_numerictests + @$(NUMERIC_TEST_STR) test_string: - @/bin/sh ./run_stringtests + @$(STRING_TEST_STR) + +install: all +ifdef INSTALL_KSFT_PATH + install $(INSTALL_PROGS) $(INSTALL_KSFT_PATH) + @echo echo Start sysctl numeric tests .... >> $(KSELFTEST) + @echo "$(NUMERIC_TEST_STR)" >> $(KSELFTEST) + @echo echo End sysctl numeric tests .... >> $(KSELFTEST) + @echo echo -------------------- >> $(KSELFTEST) + @echo echo Start sysctl string tests .... >> $(KSELFTEST) + @echo "$(STRING_TEST_STR)" >> $(KSELFTEST) + @echo echo End sysctl string test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif run_tests: all test_num test_string
Signature · 1 line
1.9.1
PATCH v2 17/19 selftests/timers: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/timers/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tools/testing/selftests/timers/Makefile +14 -1
@@ -1,8 +1,21 @@ +TEST_STR = ./posix_timers + all: gcc posix_timers.c -o posix_timers -lrt +install: +ifdef INSTALL_KSFT_PATH + install ./posix_timers $(INSTALL_KSFT_PATH) + @echo echo Start timers test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End timers test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - ./posix_timers + @$(TEST_STR) clean: rm -f ./posix_timers
Signature · 1 line
1.9.1
PATCH v2 18/19 selftests/vm: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/vm/Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
tools/testing/selftests/vm/Makefile +13 -1
@@ -4,13 +4,25 @@ CC = $(CROSS_COMPILE)gcc CFLAGS = -Wall BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest BINARIES += transhuge-stress +TEST_STR = /bin/sh ./run_vmtests || echo vmtests: [FAIL] all: $(BINARIES) %: %.c $(CC) $(CFLAGS) -o $@ $^ +install: +ifdef INSTALL_KSFT_PATH + install run_vmtests $(BINARIES) $(INSTALL_KSFT_PATH) + @echo echo Start vm test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End vm test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1) + @$(TEST_STR) clean: $(RM) $(BINARIES)
Signature · 1 line
1.9.1
PATCH v2 19/19 selftests/user: add install target to enable installing test
In reply to Shuah KhanAdd a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
--- tools/testing/selftests/user/Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
tools/testing/selftests/user/Makefile +14 -1
@@ -1,7 +1,20 @@ # Makefile for user memory selftests +TEST_STR = ./test_user_copy.sh + # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" all: +install: +ifdef INSTALL_KSFT_PATH + install ./test_user_copy.sh $(INSTALL_KSFT_PATH) + @echo echo Start user copy test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) + @echo echo End user copy test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + run_tests: all - ./test_user_copy.sh + @$(TEST_STR)
Signature · 1 line
1.9.1
Re: [PATCH v2 07/19] selftests/firmware: add install target to enable installing test
In reply to Shuah KhanHi,
Sorry, I still really don't like this approach. While it is all in one place (thank you for that), I think it isn't a form that is very workable for the people maintaining the self tests. How about this, instead of per-Makefile customization, why not define an execution framework for these tests instead.
For example, how about every test directory must have a Makefile with the needed binary targets. A common makefile could be included that defines the "run_tests" target that calls the script "run_tests.sh" that is a shell script in the current directory. (For inspiration, see how kernel modules can be built out of tree.)
The "run_tests.sh" scripts could all include a common shell script, say "../common.sh" that provides any common variables, functions, etc (e.g. things like "Start $name test ..." should be in common.sh instead of repeated in every script, the installation logic can be in once place instead of repeated).
Then along side common.sh could be "run_installed_tests.sh" or something, used on the installed target, that would traverse each directory, etc. From this, we can have a much more data-driven framework, and a common approach to running tests.
As such, we should declare up front how tests should behave on failure. And the top-level test runner can do things like count the number of tests, failures, etc.
Then, instead of splitting up the patches by test directory, you can split them up by logical changes (e.g. defining the common "run_tests" target, and then removing the target from all the tests by including the common makefile stub that defines it).
-Kees
Quoted 75 lines · Shuah Khan
Add a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
Signed-off-by Shuah Khan <[email protected]>--- tools/testing/selftests/firmware/Makefile | 49 ++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 17 deletions(-)tools/testing/selftests/firmware/Makefile +32
-18@@ -1,25 +1,40 @@ # Makefile for firmware loading selftests # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" + +__fw_filesystem: +fw_filesystem = if /bin/sh ./fw_filesystem.sh ; then +fw_filesystem += echo fw_filesystem: ok; +fw_filesystem += else echo fw_filesystem: [FAIL]; +fw_filesystem += fi + +__fw_userhelper: +fw_userhelper = if /bin/sh ./fw_userhelper.sh ; then +fw_userhelper += echo fw_userhelper: ok; +fw_userhelper += else +fw_userhelper += echo fw_userhelper: [FAIL]; +fw_userhelper += fi + all: -fw_filesystem: - @if /bin/sh ./fw_filesystem.sh ; then \ - echo "fw_filesystem: ok"; \ - else \ - echo "fw_filesystem: [FAIL]"; \ - exit 1; \ - fi - -fw_userhelper: - @if /bin/sh ./fw_userhelper.sh ; then \ - echo "fw_userhelper: ok"; \ - else \ - echo "fw_userhelper: [FAIL]"; \ - exit 1; \ - fi - -run_tests: all fw_filesystem fw_userhelper +install: +ifdef INSTALL_KSFT_PATH + install ./fw_filesystem.sh ./fw_userhelper.sh $(INSTALL_KSFT_PATH) + @echo echo Start firmware filesystem test .... >> $(KSELFTEST) + @echo "$(fw_filesystem)" >> $(KSELFTEST) + @echo echo End firmware filesystem test .... >> $(KSELFTEST) + @echo echo -------------------- >> $(KSELFTEST) + @echo echo Start firmware userhelper test .... >> $(KSELFTEST) + @echo "$(fw_userhelper)" >> $(KSELFTEST) + @echo echo End firmware userhelper test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: + @$(fw_filesystem) + @$(fw_userhelper) # Nothing to clean up. clean: --1.9.1
Signature · 2 lines
Kees Cook Chrome OS Security
Re: [PATCH v2 07/19] selftests/firmware: add install target to enable installing test
Quoted 7 lines · Kees Cook
Hi,
Sorry, I still really don't like this approach. While it is all in one place (thank you for that), I think it isn't a form that is very workable for the people maintaining the self tests. How about this, instead of per-Makefile customization, why not define an execution framework for these tests instead.
If I understand correctly, sounds like you don't like the way install target is implemented in the individual test Makefiles and the changes I made to run_tests targets to address the code duplication concern.
At the moment there is no duplicate code in this patch series between install and run_tests targets. This is a first step towards standardizing the framework and a definite improvement over what we have currently. As I mentioned earlier, my goal is to make it easier for developers to install and run the existing tests and evolve the framework as we go.
Assuming my understanding is correct that:
-- install and run_tests targets in individual tests can be
refined and automated with a common Makefile approach you proposed.
-- the rest of the user-interface kselftest_install and kselftest
are good.
I would like to propose that we get started with the current implementation and refine it based on the following ideas you suggested. The refinements you are recommending are confined to selftests and can be made after the kselftest_install gets added. Adding kselftest_install makes it easier to make the refinements as it defines overall UI.
Quoted 18 lines
For example, how about every test directory must have a
Makefilewith the needed binary targets. A common makefile could be included that defines the "run_tests" target that calls the script "run_tests.sh" that is a shell script in the current directory. (For inspiration, see how kernel modules can be built out of tree.)The "
run_tests.sh" scripts could all include a common shell script, say "../common.sh" that provides any common variables, functions, etc (e.g. things like "Start $name test ..." should be incommon.shinstead of repeated in every script, the installation logic can be in once place instead of repeated).Then along side
common.shcould be "run_installed_tests.sh" or something, used on the installed target, that would traverse each directory, etc. From this, we can have a much more data-driven framework, and a common approach to running tests.
Quoted 9 lines
As such, we should declare up front how tests should behave on failure. And the top-level test runner can do things like count the number of tests, failures, etc.
Then, instead of splitting up the patches by test directory, you can split them up by logical changes (e.g. defining the common "
run_tests" target, and then removing the target from all the tests by including the common makefile stub that defines it).
These are good ideas and I am with on evolving the framework to make it easier to maintain individual tests. Patches are welcome.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
In reply to Shuah KhanQuoted 43 lines · Shuah Khan
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on
kselftest_installand runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.Approach:
make
kselftest_target:
-- exports kselftestINSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:selftests make install target
-- createskselftest.shscript in install install dir
-- runs install targets for allINSTALL_TARGETS
(Note: ftrace and powerpc aren't included inINSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to theksefltest.shfile to add commands to run test -- install target can be run only from top level source dir.Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directoryMaintains the following ways to run tests:
-- make -Ctools/testing/selftestsrun_tests
-- make -Ctools/testing/selftestsTARGETS=targetrun_tests
Ability specify targets: e.g TARGETS=net
-- makerun_testsfromtools/testing/selftests
-- makerun_testsfrom individual test directories:
e.g: makerun_testsintools/testing/selftests/breakpoints
Quoted 4 lines
Signed-off-by Shuah Khan <[email protected]>--- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
Hi Marek,
Did you get a chance to take a look at this patch?
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 07/19] selftests/firmware: add install target to enable installing test
In reply to Shuah KhanQuoted 29 lines · Shuah Khan
Quoted 7 lines · Kees Cook
Hi,
Sorry, I still really don't like this approach. While it is all in one place (thank you for that), I think it isn't a form that is very workable for the people maintaining the self tests. How about this, instead of per-Makefile customization, why not define an execution framework for these tests instead.
If I understand correctly, sounds like you don't like the way install target is implemented in the individual test Makefiles and the changes I made to
run_teststargets to address the code duplication concern.At the moment there is no duplicate code in this patch series between install and
run_teststargets. This is a first step towards standardizing the framework and a definite improvement over what we have currently. As I mentioned earlier, my goal is to make it easier for developers to install and run the existing tests and evolve the framework as we go.Assuming my understanding is correct that:
-- install and
run_teststargets in individual tests can be
refined and automated with a commonMakefileapproach you proposed.
-- the rest of the user-interfacekselftest_installand kselftest
are good.
Quoted 7 lines
I would like to propose that we get started with the current implementation and refine it based on the following ideas you suggested. The refinements you are recommending are confined to selftests and can be made after the
kselftest_installgets added. Addingkselftest_installmakes it easier to make the refinements as it defines overall UI.
Hi Kees,
Are you ok with the above proposal? I understand this approach might not be perfect, however it is a step in the right direction to enable and make it easier to run them. I would like to get some initial work in for 3.19 if at all possible.
I plan to evolve the back-end to make it easier to write and maintain for developers writing tests going forward.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
In reply to Shuah KhanQuoted 9 lines · Shuah Khan
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on
kselftest_installand runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.Approach:
make
kselftest_target:
kselftest_install?
Quoted 4 lines
-- exports kselftest
INSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:
This direction is OK to me.
BTW, I've found another path to make selftest in Makefile, Actually you can do
make -C tools/ selftest
And there are selftest_install and selftest_clean targets (but currently it has a bug and doesn't work, anyway)
I think we'd better do subdir make instead of adding these targets. This means that "make kselftest*" should be an alias of "make -C tools/ selftest*"
Also, I'd like to request passing some options like as O=$(objtree) so that we can make test kmodules in selftests.
Thank you,
Signature · 4 lines
Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: [email protected]
Re: [PATCH v2 03/19] selftests: add install target to enable installing selftests
In reply to Shuah KhanQuoted 58 lines · Shuah Khan
Add a new make target to enable installing selftests. This new target will call install targets for the tests that are specified in
INSTALL_TARGETS. During install, a script is generated to run tests that are installed. This script will be installed in the selftest install directory. Individual test Makefiles are changed to add to the script. This will allow new tests to add install and run test commands to the generated kselftest script.run_teststarget runs the generated kselftest script to run tests when it is initiated from from "make kselftest" from top level source directory.Approach:
make
kselftest_target:
-- exports kselftestINSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:selftests make install target
-- createskselftest.shscript in install install dir
-- runs install targets for allINSTALL_TARGETS
(Note: ftrace and powerpc aren't included inINSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to theksefltest.shfile to add commands to run test -- install target can be run only from top level source dir.Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directoryMaintains the following ways to run tests:
-- make -Ctools/testing/selftestsrun_tests
-- make -Ctools/testing/selftestsTARGETS=targetrun_tests
Ability specify targets: e.g TARGETS=net
-- makerun_testsfromtools/testing/selftests
-- makerun_testsfrom individual test directories:
e.g: makerun_testsintools/testing/selftests/breakpointsSigned-off-by Shuah Khan <[email protected]>--- tools/testing/selftests/Makefile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)tools/testing/selftests/Makefile +0
-0
tools/testing/selftests/Makefile TARGETS += sysctl · line 25
Quoted 10 lines
tools/testing/selftests/Makefile +4
-0@@ -16,6 +16,10 @@ TARGETS += sysctl TARGETS += firmware TARGETS += ftrace +INSTALL_TARGETS = breakpoints cpu-hotplug efivarfs firmware ipc +INSTALL_TARGETS += kcmp memfd memory-hotplug mqueue mount net +INSTALL_TARGETS += ptrace sysctl timers user vm + TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug
I think KSELFTEST itself should be defined here, since that is not a parameter.
Quoted 5 lines
tools/testing/selftests/Makefile +0
-1@@ -24,10 +28,35 @@ all: make -C $$TARGET; \ done; -run_tests: all
tools/testing/selftests/Makefile all: · line 40
Quoted 10 lines
tools/testing/selftests/Makefile +10
-0+install: +ifdef INSTALL_KSFT_PATH + make all + @echo #!/bin/sh\n# Kselftest Run Tests .... >> $(KSELFTEST) + @echo # This file is generated during kselftest_install >> $(KSELFTEST) + @echo # Please don't change it !!\n >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) + for TARGET in $(INSTALL_TARGETS); do \ + echo Installing $$TARGET; \ + make -C $$TARGET install; \
Please pass O= option and others here.
tools/testing/selftests/Makefile all: · line 49
Quoted 9 lines
tools/testing/selftests/Makefile +9
-0+ done; + chmod +x $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: +ifdef INSTALL_KSFT_PATH + @cd $(INSTALL_KSFT_PATH); ./kselftest.sh; cd -
We'd better use some macro instead of ./kselftest.sh?
Thank you,
Quoted 14 lines
tools/testing/selftests/Makefile +7
-0+# TODO: include ftrace and powerpc in install targets + for TARGET in ftrace powerpc; do \ + make -C $$TARGET run_tests; \ + done; +else + make all for TARGET in $(TARGETS); do \ make -C $$TARGET run_tests; \ done; +endif hotplug: for TARGET in $(TARGETS_HOTPLUG); do \
Signature · 4 lines
Masami HIRAMATSU Software Platform Research Dept. Linux Technology Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: [email protected]
Re: [PATCH v2 11/19] selftests/memory-hotplug: add install target to enable installing test
In reply to Shuah KhanQuoted 23 lines · Shuah Khan
Add a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
Signed-off-by Shuah Khan <[email protected]>--- tools/testing/selftests/memory-hotplug/Makefile | 17 +- .../selftests/memory-hotplug/mem-on-off-test.sh | 238 +++++++++++++++++++++ .../selftests/memory-hotplug/on-off-test.sh | 238 --------------------- 3 files changed, 253 insertions(+), 240 deletions(-) create mode 100644 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh delete mode 100644 tools/testing/selftests/memory-hotplug/on-off-test.shtools/testing/selftests/memory-hotplug/Makefile +2
-0@@ -1,9 +1,22 @@ +TEST_STR=/bin/bash ./mem-on-off-test.sh -r 2 || echo memory-hotplug selftests: [FAIL] + all:
tools/testing/selftests/memory-hotplug/Makefile line 14
Quoted 10 lines
tools/testing/selftests/memory-hotplug/Makefile +10
-0+install: +ifdef INSTALL_KSFT_PATH + install ./mem-on-off-test.sh $(INSTALL_KSFT_PATH)/mem-on-off-test.sh + @echo echo Start memory hotplug test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) >> $(KSELFTEST) + @echo echo End memory hotplug test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif
I saw this pattern repeated many times in this series.
Can we make it a macro and include it instead of repeating this code?
Thank you,
Signature · 4 lines
Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: [email protected]
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
In reply to Shuah KhanQuoted 54 lines · Shuah Khan
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on
kselftest_installand runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.Approach:
make
kselftest_target:
-- exports kselftestINSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:selftests make install target
-- createskselftest.shscript in install install dir
-- runs install targets for allINSTALL_TARGETS
(Note: ftrace and powerpc aren't included inINSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to theksefltest.shfile to add commands to run test -- install target can be run only from top level source dir.Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directoryMaintains the following ways to run tests:
-- make -Ctools/testing/selftestsrun_tests
-- make -Ctools/testing/selftestsTARGETS=targetrun_tests
Ability specify targets: e.g TARGETS=net
-- makerun_testsfromtools/testing/selftests
-- makerun_testsfrom individual test directories:
e.g: makerun_testsintools/testing/selftests/breakpointsSigned-off-by Shuah Khan <[email protected]>--- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)Makefile +0
-0@@ -1071,12 +1071,26 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
Makefile headers_check: headers_install · line 1080
Quoted 10 lines
Makefile +7
-1# --------------------------------------------------------------------------- -# Kernel selftest +# Kernel selftest targets + +PHONY += __kselftest_configure +INSTALL_KSFT_PATH=$(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) +export INSTALL_KSFT_PATH +KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh +export KSELFTEST
Can this be moved to tools/testing/selftests/Makefile? It's only used in this part of the tree.
Makefile headers_check: headers_install · line 1091
Quoted 11 lines
Makefile +7
-1PHONY += kselftest -kselftest: +kselftest: kselftest_install $(Q)$(MAKE) -C tools/testing/selftests run_tests +# Kernel selftest install + +PHONY += kselftest_install +kselftest_install: __kselftest_configure + @rm -rf $(INSTALL_KSFT_PATH) + @mkdir -p $(INSTALL_KSFT_PATH)
Please use $(Q) insteaf od hardcoding the @.
Makefile headers_check: headers_install · line 1092
Quoted 1 line
Makefile +1
-0+ $(Q)$(MAKE) -C tools/testing/selftests install
The install target is only added by the next patch, which in turn depends on changes done by later patches. The order (in the current numbering) should be 01/19, 04/19, ... 19/19, 03/19 and 02/19.
Michal
Re: [PATCH v2 11/19] selftests/memory-hotplug: add install target to enable installing test
In reply to Masami HiramatsuQuoted 24 lines · Masami Hiramatsu
Quoted 23 lines · Shuah Khan
Add a new make target to enable installing test. This target installs test in the kselftest install location and add to the kselftest script to run the test. Install target can be run only from top level source dir.
Signed-off-by Shuah Khan <[email protected]>--- tools/testing/selftests/memory-hotplug/Makefile | 17 +- .../selftests/memory-hotplug/mem-on-off-test.sh | 238 +++++++++++++++++++++ .../selftests/memory-hotplug/on-off-test.sh | 238 --------------------- 3 files changed, 253 insertions(+), 240 deletions(-) create mode 100644 tools/testing/selftests/memory-hotplug/mem-on-off-test.sh delete mode 100644 tools/testing/selftests/memory-hotplug/on-off-test.shtools/testing/selftests/memory-hotplug/Makefile +2
-0@@ -1,9 +1,22 @@ +TEST_STR=/bin/bash ./mem-on-off-test.sh -r 2 || echo memory-hotplug selftests: [FAIL] + all:
Quoted 14 lines
tools/testing/selftests/memory-hotplug/Makefile line 14
Quoted 10 lines
tools/testing/selftests/memory-hotplug/Makefile +10
-0+install: +ifdef INSTALL_KSFT_PATH + install ./mem-on-off-test.sh $(INSTALL_KSFT_PATH)/mem-on-off-test.sh + @echo echo Start memory hotplug test .... >> $(KSELFTEST) + @echo "$(TEST_STR)" >> $(KSELFTEST) >> $(KSELFTEST) + @echo echo End memory hotplug test .... >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endifI saw this pattern repeated many times in this series.
Can we make it a macro and include it instead of repeating this code?
I might be able to move this to the selftest Makfile and use target as the string. I will play with it and see if I can reduce the duplication further.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 03/19] selftests: add install target to enable installing selftests
In reply to Masami HiramatsuQuoted 62 lines · Masami Hiramatsu
Quoted 61 lines · Shuah Khan
Add a new make target to enable installing selftests. This new target will call install targets for the tests that are specified in
INSTALL_TARGETS. During install, a script is generated to run tests that are installed. This script will be installed in the selftest install directory. Individual test Makefiles are changed to add to the script. This will allow new tests to add install and run test commands to the generated kselftest script.run_teststarget runs the generated kselftest script to run tests when it is initiated from from "make kselftest" from top level source directory.Approach:
make
kselftest_target:
-- exports kselftestINSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:selftests make install target
-- createskselftest.shscript in install install dir
-- runs install targets for allINSTALL_TARGETS
(Note: ftrace and powerpc aren't included inINSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to theksefltest.shfile to add commands to run test -- install target can be run only from top level source dir.Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directoryMaintains the following ways to run tests:
-- make -Ctools/testing/selftestsrun_tests
-- make -Ctools/testing/selftestsTARGETS=targetrun_tests
Ability specify targets: e.g TARGETS=net
-- makerun_testsfromtools/testing/selftests
-- makerun_testsfrom individual test directories:
e.g: makerun_testsintools/testing/selftests/breakpointsSigned-off-by Shuah Khan <[email protected]>--- tools/testing/selftests/Makefile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-)tools/testing/selftests/Makefile +0
-0@@ -16,6 +16,10 @@ TARGETS += sysctl TARGETS += firmware TARGETS += ftrace
Quoted 10 lines
tools/testing/selftests/Makefile TARGETS += sysctl · line 25
Quoted 7 lines
tools/testing/selftests/Makefile +4
-0+INSTALL_TARGETS = breakpoints cpu-hotplug efivarfs firmware ipc +INSTALL_TARGETS += kcmp memfd memory-hotplug mqueue mount net +INSTALL_TARGETS += ptrace sysctl timers user vm + TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplugI think KSELFTEST itself should be defined here, since that is not a parameter.
I can do that.
Quoted 5 lines
Quoted 5 lines
tools/testing/selftests/Makefile +0
-0@@ -24,10 +28,35 @@ all: make -C $$TARGET; \ done;
Quoted 13 lines
tools/testing/selftests/Makefile all: · line 40
Quoted 11 lines
tools/testing/selftests/Makefile +10
-1-run_tests: all +install: +ifdef INSTALL_KSFT_PATH + make all + @echo #!/bin/sh\n# Kselftest Run Tests .... >> $(KSELFTEST) + @echo # This file is generated during kselftest_install >> $(KSELFTEST) + @echo # Please don't change it !!\n >> $(KSELFTEST) + @echo echo ============================== >> $(KSELFTEST) + for TARGET in $(INSTALL_TARGETS); do \ + echo Installing $$TARGET; \ + make -C $$TARGET install; \Please pass O= option and others here.
I will change that.
Quoted 13 lines
tools/testing/selftests/Makefile all: · line 49
Quoted 10 lines
tools/testing/selftests/Makefile +9
-0+ done; + chmod +x $(KSELFTEST) +else + @echo Run make kselftest_install in top level source directory +endif + +run_tests: +ifdef INSTALL_KSFT_PATH + @cd $(INSTALL_KSFT_PATH); ./kselftest.sh; cd -We'd better use some macro instead of ./kselftest.sh?
I can play with this and see if there is a better way.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
In reply to Masami HiramatsuQuoted 7 lines · Masami Hiramatsu
Quoted 6 lines · Shuah Khan
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on
kselftest_installand runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.
Quoted 5 lines
Quoted 3 lines
Approach:
make
kselftest_target:
kselftest_install?
Thanks for catching this. Will fix it.
Quoted 8 lines
Quoted 5 lines
-- exports kselftest
INSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:This direction is OK to me.
Quoted 7 lines
BTW, I've found another path to make selftest in
Makefile, Actually you can domake -C
tools/selftestAnd there are
selftest_installandselftest_cleantargets (but currently it has a bug and doesn't work, anyway)
Thanks for pointing this out. I didn't know this existed. kind of hidden.
Quoted 4 lines
I think we'd better do subdir make instead of adding these targets. This means that "make kselftest*" should be an alias of "make -C
tools/selftest*"
Yes that would be a good way to go and helps leverage these options at tools/Makefile level.
Quoted 2 lines
Also, I'd like to request passing some options like as O=$(objtree) so that we can make test kmodules in selftests.
Sounds good. I will look into it.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
In reply to Michal MarekQuoted 56 lines · Michal Marek
Quoted 55 lines · Shuah Khan
Add a new make target to install to install kernel selftests. This new target will build and install selftests. kselftest target now depends on
kselftest_installand runs the generated kselftest script to reduce duplicate work and for common look and feel when running tests.Approach:
make
kselftest_target:
-- exports kselftestINSTALL_KSFT_PATH
default $(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE)
-- exports path forksefltest.sh
-- runs selftests make install target:selftests make install target
-- createskselftest.shscript in install install dir
-- runs install targets for allINSTALL_TARGETS
(Note: ftrace and powerpc aren't included inINSTALL_TARGETS,
to not add more content to patch v1 series. This work will happen soon. In this series these two targets are run after running the generated kselftest script, without any regression in the way these tests are run with "make kselftest" prior to this work.)
-- install target can be run only from top level source dir.Individual test make install targets:
-- install test programs and/or scripts in install dir -- append to theksefltest.shfile to add commands to run test -- install target can be run only from top level source dir.Adds the following new ways to initiate selftests:
-- Installing and running kselftest from install directory
by running "make kselftest"
-- Running kselftest script from install directoryMaintains the following ways to run tests:
-- make -Ctools/testing/selftestsrun_tests
-- make -Ctools/testing/selftestsTARGETS=targetrun_tests
Ability specify targets: e.g TARGETS=net
-- makerun_testsfromtools/testing/selftests
-- makerun_testsfrom individual test directories:
e.g: makerun_testsintools/testing/selftests/breakpointsSigned-off-by Shuah Khan <[email protected]>--- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)Makefile +0
-0@@ -1071,12 +1071,26 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1
Quoted 12 lines
Makefile headers_check: headers_install · line 1080
Quoted 9 lines
Makefile +7
-1# --------------------------------------------------------------------------- -# Kernel selftest +# Kernel selftest targets + +PHONY += __kselftest_configure +INSTALL_KSFT_PATH=$(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) +export INSTALL_KSFT_PATH +KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh +export KSELFTESTCan this be moved to
tools/testing/selftests/Makefile? It's only used in this part of the tree.
I looked into doing that. KERNELRELEASE will have to be exported for tools/testing/selftests/Makefile to use it? Does that sound okay?
Quoted 7 lines
Quoted 7 lines
Makefile +1
-1PHONY += kselftest -kselftest: +kselftest: kselftest_install $(Q)$(MAKE) -C tools/testing/selftests run_tests
Quoted 8 lines
Makefile headers_check: headers_install · line 1091
Quoted 6 lines
Makefile +6
-0+# Kernel selftest install + +PHONY += kselftest_install +kselftest_install: __kselftest_configure + @rm -rf $(INSTALL_KSFT_PATH) + @mkdir -p $(INSTALL_KSFT_PATH)Please use $(Q) insteaf od hardcoding the @.
I can do that.
Quoted 8 lines
Makefile headers_check: headers_install · line 1092
Quoted 3 lines
Makefile +1
-0+ $(Q)$(MAKE) -C tools/testing/selftests installThe install target is only added by the next patch, which in turn depends on changes done by later patches. The order (in the current numbering) should be 01/19, 04/19, ... 19/19, 03/19 and 02/19.
Right. I can re-order the patches in my next version and make other changes you recommended.
Also, it might be easier to get this series in, if you can Ack the main Makefile patch (when we are ready i.e), so I can take it through kselftest tree.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
Quoted 22 lines · Shuah Khan
Quoted 8 lines · Michal Marek
Quoted 7 lines · Shuah Khan
Makefile +0
-0@@ -1071,12 +1071,26 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1Quoted 12 lines
Makefile headers_check: headers_install · line 1080
Quoted 9 lines
Makefile +7
-1# --------------------------------------------------------------------------- -# Kernel selftest +# Kernel selftest targets + +PHONY += __kselftest_configure +INSTALL_KSFT_PATH=$(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) +export INSTALL_KSFT_PATH +KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh +export KSELFTESTCan this be moved to
tools/testing/selftests/Makefile? It's only used in this part of the tree.
Quoted 2 lines
I looked into doing that. KERNELRELEASE will have to be exported for
tools/testing/selftests/Makefileto use it? Does that sound okay?
In fact, KERNELRELEASE is already exported. So go ahead.
Quoted 3 lines
Also, it might be easier to get this series in, if you can Ack the main
Makefilepatch (when we are ready i.e), so I can take it through kselftest tree.
Sure. The Makefile change will only consist of redirecting the kselftest_install target to tools/testing/selftests, right?
Michal
Re: [PATCH v2 02/19] kbuild: kselftest_install - add a new make target to install selftests
Quoted 23 lines · Michal Marek
Quoted 22 lines · Shuah Khan
Quoted 20 lines · Michal Marek
Quoted 6 lines · Shuah Khan
Makefile +0
-0@@ -1071,12 +1071,26 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=arch/$(hdr-arch)/include/uapi/asm $(hdr-dst) HDRCHECK=1Makefile headers_check: headers_install · line 1080
Quoted 10 lines
Makefile +7
-1# --------------------------------------------------------------------------- -# Kernel selftest +# Kernel selftest targets + +PHONY += __kselftest_configure +INSTALL_KSFT_PATH=$(INSTALL_MOD_PATH)/lib/kselftest/$(KERNELRELEASE) +export INSTALL_KSFT_PATH +KSELFTEST=$(INSTALL_KSFT_PATH)/kselftest.sh +export KSELFTESTCan this be moved to
tools/testing/selftests/Makefile? It's only used in this part of the tree.
Quoted 4 lines
Quoted 2 lines
I looked into doing that. KERNELRELEASE will have to be exported for
tools/testing/selftests/Makefileto use it? Does that sound okay?In fact, KERNELRELEASE is already exported. So go ahead.
Good.
Quoted 9 lines
Quoted 5 lines
Also, it might be easier to get this series in, if you can Ack the main
Makefilepatch (when we are ready i.e), so I can take it through kselftest tree.Sure. The
Makefilechange will only consist of redirecting thekselftest_installtarget totools/testing/selftests, right?
Correct. I plan to keep the selftests specific work under the selftests related Makefiles.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978