Improve selftests
Subsystems (2)
cover Improve selftests
First two are cleanups, third adds hugetlbfstest. This test fails on current kernels, but I have previously sent a patchset to fix the two failures.
Joern Engel (3):
selftests: exit 1 on failure
self-test: fix make clean
selftests: add hugetlbfstest
tools/testing/selftests/vm/Makefile | 7 ++- tools/testing/selftests/vm/hugetlbfstest.c | 84 ++++++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 16 ++++++ 3 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 tools/testing/selftests/vm/hugetlbfstest.c
Signature · 7 lines
1.7.10.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 2/3 self-test: fix make clean
thuge-gen was forgotten. Fix it by removing the duplication, so we don't get too many repeats.
--- tools/testing/selftests/vm/Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/vm/Makefile +3 -2
@@ -2,8 +2,9 @@ CC = $(CROSS_COMPILE)gcc CFLAGS = -Wall +BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen -all: hugepage-mmap hugepage-shm map_hugetlb thuge-gen +all: $(BINARIES) %: %.c $(CC) $(CFLAGS) -o $@ $^
@@ -11,4 +12,4 @@ run_tests: all @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1) clean: - $(RM) hugepage-mmap hugepage-shm map_hugetlb + $(RM) $(BINARIES)
Signature · 7 lines
1.7.10.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 3/3 selftests: add hugetlbfstest
In reply to Joern EngelAs the confusing naming indicates, this test has some overlap with pre-existing tests. Would be nice to merge them eventually. But since it is only test code, cleanliness is much less important than mere existence.
--- tools/testing/selftests/vm/Makefile | 2 +- tools/testing/selftests/vm/hugetlbfstest.c | 84 ++++++++++++++++++++++++++++ tools/testing/selftests/vm/run_vmtests | 11 ++++ 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/vm/hugetlbfstest.c
tools/testing/selftests/vm/Makefile +1 -1
@@ -2,7 +2,7 @@ CC = $(CROSS_COMPILE)gcc CFLAGS = -Wall -BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen +BINARIES = hugepage-mmap hugepage-shm map_hugetlb thuge-gen hugetlbfstest all: $(BINARIES) %: %.c
tools/testing/selftests/vm/hugetlbfstest.c new file +84 -0
84 lines not on this page · raw message
tools/testing/selftests/vm/run_vmtests +11 -0
@@ -75,6 +75,17 @@ else echo "[PASS]" fi +echo "--------------------" +echo "running hugetlbfstest" +echo "--------------------" +./hugetlbfstest +if [ $? -ne 0 ]; then + echo "[FAIL]" + exitcode=1 +else + echo "[PASS]" +fi + #cleanup umount $mnt rm -rf $mnt
Signature · 7 lines
1.7.10.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/3 selftests: exit 1 on failure
In reply to Joern EngelIn case this ever gets scripted, it should return 0 on success and 1 on failure. Parsing the output should be left to meatbags.
--- tools/testing/selftests/vm/Makefile | 2 +- tools/testing/selftests/vm/run_vmtests | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/vm/Makefile +1 -1
@@ -8,7 +8,7 @@ all: hugepage-mmap hugepage-shm map_hugetlb thuge-gen $(CC) $(CFLAGS) -o $@ $^ run_tests: all - @/bin/sh ./run_vmtests || echo "vmtests: [FAIL]" + @/bin/sh ./run_vmtests || (echo "vmtests: [FAIL]"; exit 1) clean: $(RM) hugepage-mmap hugepage-shm map_hugetlb
tools/testing/selftests/vm/run_vmtests +5 -0
@@ -4,6 +4,7 @@ #we need 256M, below is the size in kB needmem=262144 mnt=./huge +exitcode=0 #get pagesize and freepages from /proc/meminfo while read name size unit; do
@@ -41,6 +42,7 @@ echo "--------------------" ./hugepage-mmap if [ $? -ne 0 ]; then echo "[FAIL]" + exitcode=1 else echo "[PASS]" fi
@@ -55,6 +57,7 @@ echo "--------------------" ./hugepage-shm if [ $? -ne 0 ]; then echo "[FAIL]" + exitcode=1 else echo "[PASS]" fi
@@ -67,6 +70,7 @@ echo "--------------------" ./map_hugetlb if [ $? -ne 0 ]; then echo "[FAIL]" + exitcode=1 else echo "[PASS]" fi
@@ -75,3 +79,4 @@ fi umount $mnt rm -rf $mnt echo $nr_hugepgs > /proc/sys/vm/nr_hugepages +exit $exitcode
Signature · 7 lines
1.7.10.4 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>