mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/5] kselftest improvement and cleanup
@ 2015-09-09 13:06 Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 1/5] selftests: rename jump label to static_keys Bamvor Jian Zhang
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

This is my third attempt for improving the kselftest for arm/arm64
architecture. Eventually, we hope we could build(in an cross compile
environment) and run all the kselftest cases automatically(successful
of courses). The first and second version is here[1][2].

In this series, I try to make all the testcases compiling and
installation successful.

Changes since v2:
1.  Remove the patch "selftests: only compile userfaultfd for x86 and
powperpc". Michael sent anther better patch.
2.  Improve the commits and patches according to Michael's suggestion.

c 9fae100 selftests: breakpoints: fix installing error on the architecture except x86
c a7d0f07 selftests: check before install
a 1189f67 selftests: rename jump label to static_keys
a 4ee06bb selftests: mqueue: allow extra cflags
  9767a8e selftests: mqueue: Simplify the Makefile
  980ac26 selftests: change install command to rsync
  82775ac selftests: exec: Revert to default emit rule

"c" means committed by Shuah Khan <shuahkh@osg.samsung.com>
"a" means acked by Shuah Khan <shuahkh@osg.samsung.com> or Michael Ellermani <mpe@ellerman.id.au>


Bamvor Jian Zhang (5):
  selftests: rename jump label to static_keys
  selftests: mqueue: allow extra cflags
  selftests: mqueue: simplify the Makefile
  selftests: change install command to rsync
  selftests: exec: revert to default emit rule

 tools/testing/selftests/Makefile        |  2 +-
 tools/testing/selftests/exec/Makefile   |  4 +---
 tools/testing/selftests/ftrace/Makefile |  2 +-
 tools/testing/selftests/lib.mk          | 11 ++++-------
 tools/testing/selftests/mqueue/Makefile | 10 ++++------
 5 files changed, 11 insertions(+), 18 deletions(-)

-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 1/5] selftests: rename jump label to static_keys
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
@ 2015-09-09 13:06 ` Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 2/5] selftests: mqueue: allow extra cflags Bamvor Jian Zhang
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

Commit 2bf9e0ab08c6 ("locking/static_keys: Provide a selftest")
renamed jump_label directory to static_keys and failed to update
the Makefile, causing the selftests build to fail.

This commit fixes it by updating the Makefile with the new name
and also moves the entry into the correct position to keep the
list alphabetically sorted.

Fixes: 2bf9e0ab08c6 ("locking/static_keys: Provide a selftest")
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Acked-by: Shuah Khan <shuahkh@osg.samsung.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
---
 tools/testing/selftests/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index ac40ec9..8922c21 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -17,12 +17,12 @@ TARGETS += powerpc
 TARGETS += ptrace
 TARGETS += seccomp
 TARGETS += size
+TARGETS += static_keys
 TARGETS += sysctl
 ifneq (1, $(quicktest))
 TARGETS += timers
 endif
 TARGETS += user
-TARGETS += jumplabel
 TARGETS += vm
 TARGETS += x86
 TARGETS += zram
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 2/5] selftests: mqueue: allow extra cflags
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 1/5] selftests: rename jump label to static_keys Bamvor Jian Zhang
@ 2015-09-09 13:06 ` Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 3/5] selftests: mqueue: simplify the Makefile Bamvor Jian Zhang
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

Change from = to += in order to allows the user to pass whatever
CFLAGS they wish(E.g. pass the proper headers and librareis
(popt.h and libpopt.so) in cross-compiling)

Suggested-by: Michael Ellermani <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Acked-by: Michael Ellermani <mpe@ellerman.id.au>
---
 tools/testing/selftests/mqueue/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index 0e3b41e..ca8327f 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -O2
+CFLAGS += -O2
 
 all:
 	$(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 3/5] selftests: mqueue: simplify the Makefile
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 1/5] selftests: rename jump label to static_keys Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 2/5] selftests: mqueue: allow extra cflags Bamvor Jian Zhang
@ 2015-09-09 13:06 ` Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 4/5] selftests: change install command to rsync Bamvor Jian Zhang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

Use make's implict rule for building simple C programs.

Suggested-by: Michael Ellermani <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/mqueue/Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile
index ca8327f..eebac29 100644
--- a/tools/testing/selftests/mqueue/Makefile
+++ b/tools/testing/selftests/mqueue/Makefile
@@ -1,8 +1,8 @@
 CFLAGS += -O2
+LDLIBS = -lrt -lpthread -lpopt
+TEST_PROGS := mq_open_tests mq_perf_tests
 
-all:
-	$(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt
-	$(CC) $(CFLAGS) -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt
+all: $(TEST_PROGS)
 
 include ../lib.mk
 
@@ -11,8 +11,6 @@ override define RUN_TESTS
 	@./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]"
 endef
 
-TEST_PROGS := mq_open_tests mq_perf_tests
-
 override define EMIT_TESTS
 	echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\""
 	echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\""
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 4/5] selftests: change install command to rsync
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
                   ` (2 preceding siblings ...)
  2015-09-09 13:06 ` [PATCH v3 3/5] selftests: mqueue: simplify the Makefile Bamvor Jian Zhang
@ 2015-09-09 13:06 ` Bamvor Jian Zhang
  2015-09-09 13:06 ` [PATCH v3 5/5] selftests: exec: revert to default emit rule Bamvor Jian Zhang
  2015-09-14 22:53 ` [PATCH v3 0/5] kselftest improvement and cleanup Shuah Khan
  5 siblings, 0 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

The command of install could not handle the special files in exec
testcases, change the default rule to rsync to fix this.

The installation is unchanged after this commit.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/ftrace/Makefile |  2 +-
 tools/testing/selftests/lib.mk          | 11 ++++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile
index 0acbeca..4e6ed13 100644
--- a/tools/testing/selftests/ftrace/Makefile
+++ b/tools/testing/selftests/ftrace/Makefile
@@ -1,7 +1,7 @@
 all:
 
 TEST_PROGS := ftracetest
-TEST_DIRS := test.d/
+TEST_DIRS := test.d
 
 include ../lib.mk
 
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk
index 97f1c67..50a93f5 100644
--- a/tools/testing/selftests/lib.mk
+++ b/tools/testing/selftests/lib.mk
@@ -12,13 +12,10 @@ run_tests: all
 	$(RUN_TESTS)
 
 define INSTALL_RULE
-	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then			\
-		mkdir -p $(INSTALL_PATH);								\
-		for TEST_DIR in $(TEST_DIRS); do							\
-			cp -r $$TEST_DIR $(INSTALL_PATH);						\
-		done;											\
-		echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)";	\
-		install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES);		\
+	@if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then					\
+		mkdir -p ${INSTALL_PATH};										\
+		echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/";	\
+		rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/;		\
 	fi
 endef
 
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v3 5/5] selftests: exec: revert to default emit rule
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
                   ` (3 preceding siblings ...)
  2015-09-09 13:06 ` [PATCH v3 4/5] selftests: change install command to rsync Bamvor Jian Zhang
@ 2015-09-09 13:06 ` Bamvor Jian Zhang
  2015-09-14 22:53 ` [PATCH v3 0/5] kselftest improvement and cleanup Shuah Khan
  5 siblings, 0 replies; 7+ messages in thread
From: Bamvor Jian Zhang @ 2015-09-09 13:06 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, khilman, tyler.baker, bamvor.zhangjian, shuahkh, mpe

With the previous patch, the installation method change from install
to rsync. There is no need to create subdir during test, the
default EMIT_TESTS is enough.

This patch essentially revert commit 84cbd9e4 ("selftests/exec: do not
install subdir as it is already created").

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
---
 tools/testing/selftests/exec/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile
index 6b76bfd..4e400eb 100644
--- a/tools/testing/selftests/exec/Makefile
+++ b/tools/testing/selftests/exec/Makefile
@@ -1,6 +1,6 @@
 CFLAGS = -Wall
 BINARIES = execveat
-DEPS = execveat.symlink execveat.denatured script
+DEPS = execveat.symlink execveat.denatured script subdir
 all: $(BINARIES) $(DEPS)
 
 subdir:
@@ -22,7 +22,5 @@ TEST_FILES := $(DEPS)
 
 include ../lib.mk
 
-override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\""
-
 clean:
 	rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx*
-- 
2.1.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v3 0/5] kselftest improvement and cleanup
  2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
                   ` (4 preceding siblings ...)
  2015-09-09 13:06 ` [PATCH v3 5/5] selftests: exec: revert to default emit rule Bamvor Jian Zhang
@ 2015-09-14 22:53 ` Shuah Khan
  5 siblings, 0 replies; 7+ messages in thread
From: Shuah Khan @ 2015-09-14 22:53 UTC (permalink / raw)
  To: Bamvor Jian Zhang, linux-kernel
  Cc: broonie, khilman, tyler.baker, mpe, Shuah Khan

On 09/09/2015 07:06 AM, Bamvor Jian Zhang wrote:

> Bamvor Jian Zhang (5):
>   selftests: rename jump label to static_keys
>   selftests: mqueue: allow extra cflags
>   selftests: mqueue: simplify the Makefile
>   selftests: change install command to rsync
>   selftests: exec: revert to default emit rule
> 
>  tools/testing/selftests/Makefile        |  2 +-
>  tools/testing/selftests/exec/Makefile   |  4 +---
>  tools/testing/selftests/ftrace/Makefile |  2 +-
>  tools/testing/selftests/lib.mk          | 11 ++++-------
>  tools/testing/selftests/mqueue/Makefile | 10 ++++------
>  5 files changed, 11 insertions(+), 18 deletions(-)
> 

The above 5 patches are now in linux-kselftest fixes for 4.3-rc2
Thanks for finding and fixing these.

-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-14 22:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-09 13:06 [PATCH v3 0/5] kselftest improvement and cleanup Bamvor Jian Zhang
2015-09-09 13:06 ` [PATCH v3 1/5] selftests: rename jump label to static_keys Bamvor Jian Zhang
2015-09-09 13:06 ` [PATCH v3 2/5] selftests: mqueue: allow extra cflags Bamvor Jian Zhang
2015-09-09 13:06 ` [PATCH v3 3/5] selftests: mqueue: simplify the Makefile Bamvor Jian Zhang
2015-09-09 13:06 ` [PATCH v3 4/5] selftests: change install command to rsync Bamvor Jian Zhang
2015-09-09 13:06 ` [PATCH v3 5/5] selftests: exec: revert to default emit rule Bamvor Jian Zhang
2015-09-14 22:53 ` [PATCH v3 0/5] kselftest improvement and cleanup Shuah Khan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome