tools: selftests cleanup
Subsystems (4)
cover tools: selftests cleanup
A couple of small patches to make working with selftests easier.
Peter Feiner (3):
tools: add .gitignore entries for selftests
tools: fix warning in memfd_test
tools: parallel selftests building & running
tools/testing/selftests/Makefile | 49 +++++++++++--------------- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/memfd/memfd_test.c | 2 +- tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/user/Makefile | 2 ++ tools/testing/selftests/vm/.gitignore | 9 ++--- 8 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH 1/3 tools: add .gitignore entries for selftests
--- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/vm/.gitignore | 9 +++++---- 5 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
tools/testing/selftests/breakpoints/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/breakpoint_test
tools/testing/selftests/efivarfs/.gitignore new file +2 -0
@@ -0,0 +1,2 @@ +/create-read +/open-unlink
tools/testing/selftests/ptrace/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/peeksiginfo
tools/testing/selftests/timers/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/posix_timers
tools/testing/selftests/vm/.gitignore +5 -4
@@ -1,4 +1,5 @@ -hugepage-mmap -hugepage-shm -map_hugetlb -thuge-gen +/hugepage-mmap +/hugepage-shm +/map_hugetlb +/thuge-gen +/hugetlbfstest
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH 2/3 tools: fix warning in memfd_test
No arguments given after printf format string with "%s" conversion.
---
There are a couple of patches floating around for this one. I'm just including it so somebody that applies this patch series doesn't get a broken build :-)
--- tools/testing/selftests/memfd/memfd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/memfd/memfd_test.c +1 -1
@@ -205,7 +205,7 @@ static void mfd_fail_open(int fd, int flags, mode_t mode)sprintf (buf,"/proc/self/fd/%d" , fd); r =open (buf, flags, mode);if (r >=0 ) { -printf ("open(%s) didn't fail as expected\n" ); +printf ("open(%s) didn't fail as expected\n" , buf);abort (); } }
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Re: [PATCH 2/3] tools: fix warning in memfd_test
Quoted 5 lines · Peter Feiner
No arguments given after printf format string with "%s" conversion.
Signed-off-by Peter Feiner <[email protected]>---
Please drop this one from the series. It is merged into linux-next (in linux-kselfest fixes branch) queued for next merge window.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
PATCH 3/3 tools: parallel selftests building & running
In reply to Peter FeinerNow make -jN builds and runs selftests in parallel. Also, if one selftest fails to build or run, make will return an error, whereas before the error was ignored.
Also added missing clean target to user/Makefile so 'make clean' doesn't fail.
--- tools/testing/selftests/Makefile | 49 ++++++++++++++--------------------- tools/testing/selftests/user/Makefile | 2 ++ 2 files changed, 22 insertions(+), 29 deletions(-)
tools/testing/selftests/Makefile +20 -29
@@ -18,32 +18,23 @@ TARGETS += firmware TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug -all: - for TARGET in $(TARGETS); do \ - make -C $$TARGET; \ - done; - -run_tests: all - for TARGET in $(TARGETS); do \ - make -C $$TARGET run_tests; \ - done; - -hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET; \ - done; - -run_hotplug: hotplug - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET run_full_test; \ - done; - -clean_hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET clean; \ - done; - -clean: - for TARGET in $(TARGETS); do \ - make -C $$TARGET clean; \ - done; +BUILD_TARGETS=$(TARGETS:%=build-%) $(TARGETS_HOTPLUG:%=build-%) +TEST_TARGETS=$(TARGETS:%=test-%) +CLEAN_TARGETS=$(TARGETS:%=clean-%) $(TARGETS_HOTPLUG:%=clean-%) + +all: $(BUILD_TARGETS) + +run_hotplug: test-cpu-hotplug test-memory-hotplug + +run_tests: $(TEST_TARGETS) + +clean: $(CLEAN_TARGETS) + +build-%: + $(MAKE) -C $(@:build-%=%) + +test-%: build-% + $(MAKE) -C $(@:test-%=%) run_tests + +clean-%: + $(MAKE) -C $(@:clean-%=%) clean
tools/testing/selftests/user/Makefile +2 -0
@@ -3,6 +3,8 @@ # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" all: +clean: + run_tests: all @if /sbin/modprobe test_user_copy ; then \ rmmod test_user_copy; \
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Re: [PATCH 3/3] tools: parallel selftests building & running
Quoted 6 lines · Peter Feiner
Now make -jN builds and runs selftests in parallel. Also, if one selftest fails to build or run, make will return an error, whereas before the error was ignored.
Also added missing clean target to user/Makefile so 'make clean' doesn't fail.
Could you please split this into two patches. One for parallel builds and the second for adding missing clean targets.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
Re: [PATCH 1/3] tools: add .gitignore entries for selftests
In reply to Peter FeinerQuoted 2 lines · Peter Feiner
Signed-off-by Peter Feiner <[email protected]>---
Please add a change log describing what this does and why it is needed. I know what you trying to fix, and that is a good one, but would like a log with the patch.
thanks,
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
v2 cover tools: selftests cleanup
In reply to Peter FeinerA couple of small patches to make working with selftests easier.
v1 -> v2:
Addressed Shuah's comments.
Peter Feiner (3):
tools: add .gitignore entries for selftests
tools: adding clean target to user selftest
tools: parallel selftests building & running
tools/testing/selftests/Makefile | 49 +++++++++++--------------- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/mount/.gitignore | 1 + tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/user/Makefile | 2 ++ tools/testing/selftests/vm/.gitignore | 9 ++--- 8 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/mount/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v2 1/3 tools: add .gitignore entries for selftests
Ignore the binaries built for selftests in 'git status' output to make development more pleasant. Without this patch, you see
tools/testing/selftests/breakpoints/breakpoint_test tools/testing/selftests/efivarfs/create-read tools/testing/selftests/efivarfs/open-unlink tools/testing/selftests/kcmp/kcmp_test tools/testing/selftests/memfd/memfd_test tools/testing/selftests/mqueue/mq_open_tests tools/testing/selftests/mqueue/mq_perf_tests tools/testing/selftests/net/psock_fanout tools/testing/selftests/net/psock_tpacket tools/testing/selftests/net/socket tools/testing/selftests/ptrace/peeksiginfo tools/testing/selftests/timers/posix_timers tools/testing/selftests/vm/hugepage-mmap tools/testing/selftests/vm/hugepage-shm tools/testing/selftests/vm/hugetlbfstest tools/testing/selftests/vm/map_hugetlb tools/testing/selftests/vm/thuge-gen tools/testing/selftests/mount/unprivileged-remount-test
in the list of untracked files.
---
v1 -> v2:
* added changelog blurb
* added mount/.gitignore for unprivileged-remount-test
--- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/mount/.gitignore | 1 + tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/vm/.gitignore | 9 +++++---- 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/mount/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
tools/testing/selftests/breakpoints/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/breakpoint_test
tools/testing/selftests/efivarfs/.gitignore new file +2 -0
@@ -0,0 +1,2 @@ +/create-read +/open-unlink
tools/testing/selftests/mount/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/unprivileged-remount-test
tools/testing/selftests/ptrace/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/peeksiginfo
tools/testing/selftests/timers/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/posix_timers
tools/testing/selftests/vm/.gitignore +5 -4
@@ -1,4 +1,5 @@ -hugepage-mmap -hugepage-shm -map_hugetlb -thuge-gen +/hugepage-mmap +/hugepage-shm +/map_hugetlb +/thuge-gen +/hugetlbfstest
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v2 2/3 tools: adding clean target to user selftest
In reply to Peter FeinerGets rid of this error when running 'make clean' in the selftests directory:
make[1]: Entering directory .../tools/testing/selftests/user' make[1]: *** No rule to make target clean'. Stop.
---
v1 -> v2:
Separated this from the parallel build patch.
--- tools/testing/selftests/user/Makefile | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/user/Makefile +2 -0
@@ -3,6 +3,8 @@ # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" all: +clean: + run_tests: all @if /sbin/modprobe test_user_copy ; then \ rmmod test_user_copy; \
Signature · 1 line
2.1.0.rc2.206.gedb03e5
Re: [PATCH v2 2/3] tools: adding clean target to user selftest
Quoted 6 lines · Peter Feiner
Gets rid of this error when running 'make clean' in the selftests directory:
make[1]: Entering directory
.../tools/testing/selftests/user' make[1]: *** No rule to make targetclean'. Stop.
Signed-off is missing. Please make sure patches have your Signed-off
-- Shuah
Signature · 4 lines
Shuah Khan Sr. Linux Kernel Developer Samsung Research America (Silicon Valley) [email protected] | (970) 217-8978
PATCH v2 3/3 tools: parallel selftests building & running
In reply to Peter FeinerNow make -jN builds and runs selftests in parallel. Also, if one selftest fails to build or run, make will return an error, whereas before the error was ignored.
---
v1 -> v2:
Moved fix for missing 'make clean' target into separate patch.
--- tools/testing/selftests/Makefile | 49 ++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 29 deletions(-)
tools/testing/selftests/Makefile +20 -29
@@ -18,32 +18,23 @@ TARGETS += firmware TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug -all: - for TARGET in $(TARGETS); do \ - make -C $$TARGET; \ - done; - -run_tests: all - for TARGET in $(TARGETS); do \ - make -C $$TARGET run_tests; \ - done; - -hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET; \ - done; - -run_hotplug: hotplug - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET run_full_test; \ - done; - -clean_hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET clean; \ - done; - -clean: - for TARGET in $(TARGETS); do \ - make -C $$TARGET clean; \ - done; +BUILD_TARGETS=$(TARGETS:%=build-%) $(TARGETS_HOTPLUG:%=build-%) +TEST_TARGETS=$(TARGETS:%=test-%) +CLEAN_TARGETS=$(TARGETS:%=clean-%) $(TARGETS_HOTPLUG:%=clean-%) + +all: $(BUILD_TARGETS) + +run_hotplug: test-cpu-hotplug test-memory-hotplug + +run_tests: $(TEST_TARGETS) + +clean: $(CLEAN_TARGETS) + +build-%: + $(MAKE) -C $(@:build-%=%) + +test-%: build-% + $(MAKE) -C $(@:test-%=%) run_tests + +clean-%: + $(MAKE) -C $(@:clean-%=%) clean
Signature · 1 line
2.1.0.rc2.206.gedb03e5
v2 cover tools: selftests cleanup
In reply to Peter FeinerA couple of small patches to make working with selftests easier.
v1 -> v2:
Addressed Shuah's comments.
v2 -> v3:
Forgot Signed-off-by footer.
*** BLURB HERE ***
Peter Feiner (3):
tools: add .gitignore entries for selftests
tools: adding clean target to user selftest
tools: parallel selftests building & running
tools/testing/selftests/Makefile | 49 +++++++++++--------------- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/mount/.gitignore | 1 + tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/user/Makefile | 2 ++ tools/testing/selftests/vm/.gitignore | 9 ++--- 8 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/mount/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 1/3 tools: add .gitignore entries for selftests
Ignore the binaries built for selftests in 'git status' output to make development more pleasant. Without this patch, you see
tools/testing/selftests/breakpoints/breakpoint_test tools/testing/selftests/efivarfs/create-read tools/testing/selftests/efivarfs/open-unlink tools/testing/selftests/kcmp/kcmp_test tools/testing/selftests/memfd/memfd_test tools/testing/selftests/mqueue/mq_open_tests tools/testing/selftests/mqueue/mq_perf_tests tools/testing/selftests/net/psock_fanout tools/testing/selftests/net/psock_tpacket tools/testing/selftests/net/socket tools/testing/selftests/ptrace/peeksiginfo tools/testing/selftests/timers/posix_timers tools/testing/selftests/vm/hugepage-mmap tools/testing/selftests/vm/hugepage-shm tools/testing/selftests/vm/hugetlbfstest tools/testing/selftests/vm/map_hugetlb tools/testing/selftests/vm/thuge-gen tools/testing/selftests/mount/unprivileged-remount-test
in the list of untracked files.
---
v1 -> v2:
* added changelog blurb
* added mount/.gitignore for unprivileged-remount-test
--- tools/testing/selftests/breakpoints/.gitignore | 1 + tools/testing/selftests/efivarfs/.gitignore | 2 ++ tools/testing/selftests/mount/.gitignore | 1 + tools/testing/selftests/ptrace/.gitignore | 1 + tools/testing/selftests/timers/.gitignore | 1 + tools/testing/selftests/vm/.gitignore | 9 +++++---- 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 tools/testing/selftests/breakpoints/.gitignore create mode 100644 tools/testing/selftests/efivarfs/.gitignore create mode 100644 tools/testing/selftests/mount/.gitignore create mode 100644 tools/testing/selftests/ptrace/.gitignore create mode 100644 tools/testing/selftests/timers/.gitignore
tools/testing/selftests/breakpoints/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/breakpoint_test
tools/testing/selftests/efivarfs/.gitignore new file +2 -0
@@ -0,0 +1,2 @@ +/create-read +/open-unlink
tools/testing/selftests/mount/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/unprivileged-remount-test
tools/testing/selftests/ptrace/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/peeksiginfo
tools/testing/selftests/timers/.gitignore new file +1 -0
@@ -0,0 +1 @@ +/posix_timers
tools/testing/selftests/vm/.gitignore +5 -4
@@ -1,4 +1,5 @@ -hugepage-mmap -hugepage-shm -map_hugetlb -thuge-gen +/hugepage-mmap +/hugepage-shm +/map_hugetlb +/thuge-gen +/hugetlbfstest
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 2/3 tools: adding clean target to user selftest
In reply to Peter FeinerGets rid of this error when running 'make clean' in the selftests directory:
make[1]: Entering directory .../tools/testing/selftests/user' make[1]: *** No rule to make target clean'. Stop.
---
v1 -> v2:
Separated this from the parallel build patch.
v2 -> v3:
Added Signed-off-by.
--- tools/testing/selftests/user/Makefile | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/user/Makefile +2 -0
@@ -3,6 +3,8 @@ # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" all: +clean: + run_tests: all @if /sbin/modprobe test_user_copy ; then \ rmmod test_user_copy; \
Signature · 1 line
2.1.0.rc2.206.gedb03e5
PATCH v3 3/3 tools: parallel selftests building & running
In reply to Peter FeinerNow make -jN builds and runs selftests in parallel. Also, if one selftest fails to build or run, make will return an error, whereas before the error was ignored.
---
v1 -> v2:
Moved fix for missing 'make clean' target into separate patch.
--- tools/testing/selftests/Makefile | 49 ++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 29 deletions(-)
tools/testing/selftests/Makefile +20 -29
@@ -18,32 +18,23 @@ TARGETS += firmware TARGETS_HOTPLUG = cpu-hotplug TARGETS_HOTPLUG += memory-hotplug -all: - for TARGET in $(TARGETS); do \ - make -C $$TARGET; \ - done; - -run_tests: all - for TARGET in $(TARGETS); do \ - make -C $$TARGET run_tests; \ - done; - -hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET; \ - done; - -run_hotplug: hotplug - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET run_full_test; \ - done; - -clean_hotplug: - for TARGET in $(TARGETS_HOTPLUG); do \ - make -C $$TARGET clean; \ - done; - -clean: - for TARGET in $(TARGETS); do \ - make -C $$TARGET clean; \ - done; +BUILD_TARGETS=$(TARGETS:%=build-%) $(TARGETS_HOTPLUG:%=build-%) +TEST_TARGETS=$(TARGETS:%=test-%) +CLEAN_TARGETS=$(TARGETS:%=clean-%) $(TARGETS_HOTPLUG:%=clean-%) + +all: $(BUILD_TARGETS) + +run_hotplug: test-cpu-hotplug test-memory-hotplug + +run_tests: $(TEST_TARGETS) + +clean: $(CLEAN_TARGETS) + +build-%: + $(MAKE) -C $(@:build-%=%) + +test-%: build-% + $(MAKE) -C $(@:test-%=%) run_tests + +clean-%: + $(MAKE) -C $(@:clean-%=%) clean
Signature · 1 line
2.1.0.rc2.206.gedb03e5