Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'linux-kselftest-5.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest fixes from Shuah Khan:
"Fixes to build failures and other test bugs"

* tag 'linux-kselftest-5.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
selftests: openat2: fix build error on newer glibc
selftests: use LDLIBS for libraries instead of LDFLAGS
selftests: fix too long argument
selftests: allow detection of build failures
Kernel selftests: tpm2: check for tpm support
selftests/ftrace: Have pid filter test use instance flag
selftests: fix spelling mistaked "chaigned" -> "chained"

+50 -29
+10 -2
tools/testing/selftests/Makefile
··· 77 77 override TARGETS := $(TMP) 78 78 endif 79 79 80 + # User can set FORCE_TARGETS to 1 to require all targets to be successfully 81 + # built; make will fail if any of the targets cannot be built. If 82 + # FORCE_TARGETS is not set (the default), make will succeed if at least one 83 + # of the targets gets built. 84 + FORCE_TARGETS ?= 85 + 80 86 # Clear LDFLAGS and MAKEFLAGS if called from main 81 87 # Makefile to avoid test build failures when test 82 88 # Makefile doesn't have explicit build rules. ··· 157 151 for TARGET in $(TARGETS); do \ 158 152 BUILD_TARGET=$$BUILD/$$TARGET; \ 159 153 mkdir $$BUILD_TARGET -p; \ 160 - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET; \ 154 + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET \ 155 + $(if $(FORCE_TARGETS),|| exit); \ 161 156 ret=$$((ret * $$?)); \ 162 157 done; exit $$ret; 163 158 ··· 212 205 @ret=1; \ 213 206 for TARGET in $(TARGETS); do \ 214 207 BUILD_TARGET=$$BUILD/$$TARGET; \ 215 - $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install; \ 208 + $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET INSTALL_PATH=$(INSTALL_PATH)/$$TARGET install \ 209 + $(if $(FORCE_TARGETS),|| exit); \ 216 210 ret=$$((ret * $$?)); \ 217 211 done; exit $$ret; 218 212
+1 -7
tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # description: ftrace - function pid filters 4 + # flags: instance 4 5 5 6 # Make sure that function pid matching filter works. 6 7 # Also test it on an instance directory ··· 97 96 } 98 97 99 98 do_test 100 - 101 - mkdir instances/foo 102 - cd instances/foo 103 - do_test 104 - cd ../../ 105 - rmdir instances/foo 106 - 107 99 do_reset 108 100 109 101 exit 0
+1 -1
tools/testing/selftests/futex/functional/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 INCLUDES := -I../include -I../../ 3 3 CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE -pthread $(INCLUDES) 4 - LDFLAGS := $(LDFLAGS) -pthread -lrt 4 + LDLIBS := -lpthread -lrt 5 5 6 6 HEADERS := \ 7 7 ../include/futextest.h \
+13 -10
tools/testing/selftests/lib.mk
··· 83 83 $(call RUN_TESTS, $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_PROGS)) 84 84 endif 85 85 86 + define INSTALL_SINGLE_RULE 87 + $(if $(INSTALL_LIST),@mkdir -p $(INSTALL_PATH)) 88 + $(if $(INSTALL_LIST),@echo rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/) 89 + $(if $(INSTALL_LIST),@rsync -a $(INSTALL_LIST) $(INSTALL_PATH)/) 90 + endef 91 + 86 92 define INSTALL_RULE 87 - @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ 88 - mkdir -p ${INSTALL_PATH}; \ 89 - echo "rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ 90 - rsync -a $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ 91 - fi 92 - @if [ "X$(TEST_GEN_PROGS)$(TEST_CUSTOM_PROGS)$(TEST_GEN_PROGS_EXTENDED)$(TEST_GEN_FILES)" != "X" ]; then \ 93 - mkdir -p ${INSTALL_PATH}; \ 94 - echo "rsync -a $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/"; \ 95 - rsync -a $(TEST_GEN_PROGS) $(TEST_CUSTOM_PROGS) $(TEST_GEN_PROGS_EXTENDED) $(TEST_GEN_FILES) $(INSTALL_PATH)/; \ 96 - fi 93 + $(eval INSTALL_LIST = $(TEST_PROGS)) $(INSTALL_SINGLE_RULE) 94 + $(eval INSTALL_LIST = $(TEST_PROGS_EXTENDED)) $(INSTALL_SINGLE_RULE) 95 + $(eval INSTALL_LIST = $(TEST_FILES)) $(INSTALL_SINGLE_RULE) 96 + $(eval INSTALL_LIST = $(TEST_GEN_PROGS)) $(INSTALL_SINGLE_RULE) 97 + $(eval INSTALL_LIST = $(TEST_CUSTOM_PROGS)) $(INSTALL_SINGLE_RULE) 98 + $(eval INSTALL_LIST = $(TEST_GEN_PROGS_EXTENDED)) $(INSTALL_SINGLE_RULE) 99 + $(eval INSTALL_LIST = $(TEST_GEN_FILES)) $(INSTALL_SINGLE_RULE) 97 100 endef 98 101 99 102 install: all
+2 -2
tools/testing/selftests/net/Makefile
··· 27 27 include ../lib.mk 28 28 29 29 $(OUTPUT)/reuseport_bpf_numa: LDLIBS += -lnuma 30 - $(OUTPUT)/tcp_mmap: LDFLAGS += -lpthread 31 - $(OUTPUT)/tcp_inq: LDFLAGS += -lpthread 30 + $(OUTPUT)/tcp_mmap: LDLIBS += -lpthread 31 + $(OUTPUT)/tcp_inq: LDLIBS += -lpthread
+1 -1
tools/testing/selftests/openat2/helpers.c
··· 46 46 47 47 int touchat(int dfd, const char *path) 48 48 { 49 - int fd = openat(dfd, path, O_CREAT); 49 + int fd = openat(dfd, path, O_CREAT, 0700); 50 50 if (fd >= 0) 51 51 close(fd); 52 52 return fd;
+1 -1
tools/testing/selftests/openat2/resolve_test.c
··· 230 230 { .name = "[in_root] garbage link to /root", 231 231 .path = "cheeky/garbageself", .how.resolve = RESOLVE_IN_ROOT, 232 232 .out.path = "root", .pass = true }, 233 - { .name = "[in_root] chainged garbage links to /root", 233 + { .name = "[in_root] chained garbage links to /root", 234 234 .path = "abscheeky/garbageself", .how.resolve = RESOLVE_IN_ROOT, 235 235 .out.path = "root", .pass = true }, 236 236 { .name = "[in_root] relative path to 'root'",
+1 -1
tools/testing/selftests/rtc/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 CFLAGS += -O3 -Wl,-no-as-needed -Wall 3 - LDFLAGS += -lrt -lpthread -lm 3 + LDLIBS += -lrt -lpthread -lm 4 4 5 5 TEST_GEN_PROGS = rtctest 6 6
+1 -1
tools/testing/selftests/timens/Makefile
··· 2 2 TEST_GEN_PROGS_EXTENDED := gettime_perf 3 3 4 4 CFLAGS := -Wall -Werror -pthread 5 - LDFLAGS := -lrt -ldl 5 + LDLIBS := -lrt -ldl 6 6 7 7 include ../lib.mk
+11 -2
tools/testing/selftests/tpm2/test_smoke.sh
··· 1 1 #!/bin/bash 2 2 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 3 + self.flags = flags 3 4 4 - python -m unittest -v tpm2_tests.SmokeTest 5 - python -m unittest -v tpm2_tests.AsyncTest 5 + # Kselftest framework requirement - SKIP code is 4. 6 + ksft_skip=4 7 + 8 + 9 + if [ -f /dev/tpm0 ] ; then 10 + python -m unittest -v tpm2_tests.SmokeTest 11 + python -m unittest -v tpm2_tests.AsyncTest 12 + else 13 + exit $ksft_skip 14 + fi 6 15 7 16 CLEAR_CMD=$(which tpm2_clear) 8 17 if [ -n $CLEAR_CMD ]; then
+8 -1
tools/testing/selftests/tpm2/test_space.sh
··· 1 1 #!/bin/bash 2 2 # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 3 3 4 - python -m unittest -v tpm2_tests.SpaceTest 4 + # Kselftest framework requirement - SKIP code is 4. 5 + ksft_skip=4 6 + 7 + if [ -f /dev/tpmrm0 ] ; then 8 + python -m unittest -v tpm2_tests.SpaceTest 9 + else 10 + exit $ksft_skip 11 + fi