several selftests fixes
Subsystems (2)
cover several selftests fixes
Hi, Andrew:
Here is several fixes for selftests.
For make run_tests the target command will cause make fail if it exit with non zero codes. So I change the makefile as below:
run_tests: all
- /bin/sh ./run_vmtests
+ @/bin/sh ./run_vmtests || echo "vmtests: [FAIL]"
Also fixed the kcmp build error.
--
Thanks
Dave
PATCH 1/8 vm selftests: print failure status instead of cause make error
bash-4.1$ make -C vm run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' /bin/sh ./run_vmtests
./run_vmtests: line 24: /proc/sys/vm/nr_hugepages: Permission denied Please run this test as root
make: *** [run_tests] Error 1
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm'
After applying the patch:
bash-4.1$ make -C vm run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm' ./run_vmtests: line 24: /proc/sys/vm/nr_hugepages: Permission denied Please run this test as root
vmtests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/vm'
--- tools/testing/selftests/vm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/vm/Makefile +1 -1
@@ -8,7 +8,7 @@ all: hugepage-mmap hugepage-shm map_hug $(CC) $(CFLAGS) -o $@ $^ run_tests: all - /bin/sh ./run_vmtests + @/bin/sh ./run_vmtests || echo "vmtests: [FAIL]" clean: $(RM) hugepage-mmap hugepage-shm map_hugetlb
PATCH 2/8 mqueue selftests: print failure status instead of cause make error
In reply to [email protected]Original behavior:
bash-4.1$ make -C mqueue run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' ./mq_open_tests /test1
Not running as root, but almost all tests require root in order to modify system settings. Exiting.
make: *** [run_tests] Error 1
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue'
After applying the patch:
bash-4.1$ make -C mqueue run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' Not running as root, but almost all tests require root in order to modify system settings. Exiting.
mq_open_tests: [FAIL]
Not running as root, but almost all tests require root in order to modify system settings. Exiting.
mq_perf_tests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue'
--- tools/testing/selftests/mqueue/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/mqueue/Makefile +2 -2
@@ -3,8 +3,8 @@ all: gcc -O2 -lrt -lpthread -lpopt -o mq_perf_tests mq_perf_tests.c run_tests: - ./mq_open_tests /test1 - ./mq_perf_tests + @./mq_open_tests /test1 || echo "mq_open_tests: [FAIL]" + @./mq_perf_tests || echo "mq_perf_tests: [FAIL]" clean: rm -f mq_open_tests mq_perf_tests
Re: [patch 2/8] mqueue selftests: print failure status instead of cause make error
Quoted 28 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
Original behavior:
bash-4.1$ make -C mqueuerun_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' ./mq_open_tests /test1
Not running as root, but almost all tests require root in order to modify system settings. Exiting.
make: *** [run_tests] Error 1
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue'After applying the patch:
bash-4.1$ make -C mqueuerun_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue' Not running as root, but almost all tests require root in order to modify system settings. Exiting.
mq_open_tests: [FAIL]
Not running as root, but almost all tests require root in order to modify system settings. Exiting.
mq_perf_tests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/mqueue'Signed-off-by Dave Young <[email protected]>--- tools/testing/selftests/mqueue/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/mqueue/Makefile 2012-11-23 22:38:43.101858919 +0800 all: · line 7
Quoted 7 lines
tools/testing/selftests/mqueue/Makefile 2012-11-23 22:38:43.101858919 +0800 renamed from tools/testing/selftests/mqueue/Makefile 2012-11-23 22:37:04.945724010 +0800 +2
-2@@ -3,8 +3,8 @@ all: gcc -O2 -lrt -lpthread -lpopt -o mq_perf_tests mq_perf_tests.c run_tests: - ./mq_open_tests /test1 - ./mq_perf_tests + @./mq_open_tests /test1 || echo "mq_open_tests: [FAIL]" + @./mq_perf_tests || echo "mq_perf_tests: [FAIL]"
I wonder though if we can make this more generic at higher level. Maybe use Python or something instead of Makefiles for test case definition?
PATCH 3/8 cpu-hotplug selftests: print failure status instead of cause make error
In reply to [email protected] bash-4.1$ make -C cpu-hotplug run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' ./on-off-test.sh
make: execvp: ./on-off-test.sh: Permission denied
make: *** [run_tests] Error 127
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug'
After applying the patch:
bash-4.1$ make -C cpu-hotplug run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' /bin/sh: ./on-off-test.sh: Permission denied
cpu-hotplug selftests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug'
--- tools/testing/selftests/cpu-hotplug/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/cpu-hotplug/Makefile +1 -1
@@ -1,6 +1,6 @@ all: run_tests: - ./on-off-test.sh + @./on-off-test.sh || echo "cpu-hotplug selftests: [FAIL]" clean:
Re: [patch 3/8] cpu-hotplug selftests: print failure status instead of cause make error
Quoted 7 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
bash-4.1$ make -C cpu-hotplug
run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug' ./on-off-test.sh
make: execvp: ./on-off-test.sh: Permission denied
make: *** [run_tests] Error 127
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug'
Quoted 8 lines
After applying the patch:
bash-4.1$ make -C cpu-hotplugrun_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug'/bin/sh: ./on-off-test.sh: Permission denied
cpu-hotplug selftests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/cpu-hotplug'Signed-off-by Dave Young <[email protected]>
PATCH 4/8 mem-hotplug selftests: print failure status instead of cause make error
In reply to [email protected] bash-4.1$ make -C memory-hotplug run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' ./on-off-test.sh
make: execvp: ./on-off-test.sh: Permission denied
make: *** [run_tests] Error 127
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug'
After applying the patch:
bash-4.1$ make -C memory-hotplug run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' /bin/sh: ./on-off-test.sh: Permission denied
memory-hotplug selftests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug'
--- tools/testing/selftests/memory-hotplug/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/memory-hotplug/Makefile +1 -1
@@ -1,6 +1,6 @@ all: run_tests: - ./on-off-test.sh + @./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" clean:
Re: [patch 4/8] mem-hotplug selftests: print failure status instead of cause make error
Quoted 7 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
bash-4.1$ make -C memory-hotplug
run_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug' ./on-off-test.sh
make: execvp: ./on-off-test.sh: Permission denied
make: *** [run_tests] Error 127
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug'
Quoted 8 lines
After applying the patch:
bash-4.1$ make -C memory-hotplugrun_tests
make: Entering directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug'/bin/sh: ./on-off-test.sh: Permission denied
memory-hotplug selftests: [FAIL]
make: Leaving directory `/home/dave/git/linux-2.6/tools/testing/selftests/memory-hotplug'Signed-off-by Dave Young <[email protected]>
It'd be good if we could turn off the make produced noise to make the output look something like this:
bash-4.1$ make -C memory-hotplug run_tests
/bin/sh: ./on-off-test.sh: Permission denied
memory-hotplug selftests: [FAIL]
Quoted 20 lines
--- tools/testing/selftests/memory-hotplug/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/memory-hotplug/Makefile 2012-11-23 22:38:43.148525333 +0800 renamed from tools/testing/selftests/memory-hotplug/Makefile 2012-11-23 22:37:04.869057759 +0800 +1
-2@@ -1,6 +1,6 @@ all: run_tests: - ./on-off-test.sh + @./on-off-test.sh || echo "memory-hotplug selftests: [FAIL]" clean: --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 5/8 kcmp selftests: make run_tests fix
In reply to [email protected]make run_tests need the target is run_tests instead of run-tests Also gcc output should be kcmp_test. Fix these two issues.
--- tools/testing/selftests/kcmp/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/kcmp/Makefile +2 -2
@@ -16,12 +16,12 @@ CFLAGS += -I../../../../arch/x86/include all: ifeq ($(ARCH),X86) - gcc $(CFLAGS) kcmp_test.c -o run_test + gcc $(CFLAGS) kcmp_test.c -o kcmp_test else echo "Not an x86 target, can't build kcmp selftest" endif -run-tests: all +run_tests: all ./kcmp_test clean:
PATCH 6/8 kcmp selftests: build fix
In reply to [email protected]For old glibc there's no the syscall number this tests will cause make run_tests fail.
Add a macro to define the number. This should be ok because it will be built in latest kernel source.
--- tools/testing/selftests/kcmp/kcmp_test.c | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/kcmp/kcmp_test.c +3 -0
@@ -17,6 +17,9 @@#include <sys/stat.h> #include <sys/wait.h> +#ifndef __NR_kcmp +#define __NR_kcmp 272 +#endif static long sys_kcmp (int pid1,int pid2,int type,int fd1,int fd2) {return syscall (__NR_kcmp, pid1, pid2, type, fd1, fd2);
Re: [patch 6/8] kcmp selftests: build fix
Quoted 13 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
For old glibc there's no the syscall number this tests will cause make
run_testsfail.
Add a macro to define the number. This should be ok because it will be built in latest kernel source.Signed-off-by Dave Young <[email protected]>--- tools/testing/selftests/kcmp/kcmp_test.c | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 line 22
Quoted 6 lines
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 renamed from tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:37:04.789058192 +0800 +3
-0@@ -17,6 +17,9 @@ #include <sys/stat.h> #include <sys/wait.h> +#ifndef __NR_kcmp +#define __NR_kcmp 272 +#endif
Is the syscall number really going to be the same across all architectures?
Quoted 9 lines
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 renamed from tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:37:04.789058192 +0800 +0
-1static long sys_kcmp(int pid1, int pid2, int type, int fd1, int fd2) { return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2); --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 6/8] kcmp selftests: build fix
Quoted 17 lines · Pekka Enberg
Quoted 16 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
For old glibc there's no the syscall number this tests will cause make
run_testsfail.
Add a macro to define the number. This should be ok because it will be built in latest kernel source.Signed-off-by Dave Young <[email protected]>--- tools/testing/selftests/kcmp/kcmp_test.c | 3 +++ 1 file changed, 3 insertions(+)tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 renamed from tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:37:04.789058192 +0800 +0
-0@@ -17,6 +17,9 @@ #include <sys/stat.h> #include <sys/wait.h>
Quoted 5 lines
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 line 22
Quoted 3 lines
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 renamed from tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:37:04.789058192 +0800 +3
-0+#ifndef __NR_kcmp +#define __NR_kcmp 272 +#endifIs the syscall number really going to be the same across all architectures?
Oh, they are different. self NACK. Please ignore this patch.
Quoted 10 lines
Quoted 10 lines
tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:38:43.195191747 +0800 renamed from tools/testing/selftests/kcmp/kcmp_test.c 2012-11-23 22:37:04.789058192 +0800 +0
-1static long sys_kcmp(int pid1, int pid2, int type, int fd1, int fd2) { return syscall(__NR_kcmp, pid1, pid2, type, fd1, fd2); --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 7/8 kcmp selftests: print fail status instead of cause make error
In reply to [email protected]In case kcmp_test exit non zero value it will cause make error. Better way is just print the test failure status.
--- tools/testing/selftests/kcmp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kcmp/Makefile +1 -1
@@ -22,7 +22,7 @@ else endif run_tests: all - ./kcmp_test + @./kcmp_test || echo "kcmp_test: [FAIL]" clean: rm -fr ./run_test
Re: [patch 7/8] kcmp selftests: print fail status instead of cause make error
Quoted 4 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
In case
kcmp_testexit non zero value it will cause make error. Better way is just print the test failure status.Signed-off-by Dave Young <[email protected]>
Quoted 21 lines
--- tools/testing/selftests/kcmp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/kcmp/Makefile 2012-11-23 23:11:52.474414896 +0800 renamed from tools/testing/selftests/kcmp/Makefile 2012-11-23 23:10:18.000000000 +0800 +1
-2@@ -22,7 +22,7 @@ else endif run_tests: all - ./kcmp_test + @./kcmp_test || echo "kcmp_test: [FAIL]" clean: rm -fr ./run_test --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 8/8 breakpoint selftests: print failure status instead of cause make error
In reply to [email protected]In case breakpoint test exit non zero value it will cause make error. Better way is just print the test failure status.
--- tools/testing/selftests/breakpoints/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/breakpoints/Makefile +1 -1
@@ -17,7 +17,7 @@ else endif run_tests: - ./breakpoint_test + @./breakpoint_test || echo "breakpoints selftests: [FAIL]" clean: rm -fr breakpoint_test
Re: [patch 8/8] breakpoint selftests: print failure status instead of cause make error
Quoted 4 lines · On Sat, Nov 24, 2012 at 10:29 AM, <[email protected]> wrote:
In case breakpoint test exit non zero value it will cause make error. Better way is just print the test failure status.
Signed-off-by Dave Young <[email protected]>
Quoted 21 lines
--- tools/testing/selftests/breakpoints/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/selftests/breakpoints/Makefile 2012-11-23 22:38:43.221858269 +0800 renamed from tools/testing/selftests/breakpoints/Makefile 2012-11-23 22:37:04.749058409 +0800 +1
-2@@ -17,7 +17,7 @@ else endif run_tests: - ./breakpoint_test + @./breakpoint_test || echo "breakpoints selftests: [FAIL]" clean: rm -fr breakpoint_test --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/