Skip to content

Commit e05d5b9

Browse files
committed
Merge tag 'linux-kselftest-next-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull Kselftest updates from Shuah Khan: - timers test build fixes and cleanups for new tool chains - removing khdr from kselftest framework and main Makefile - changes to test output messages to improve reports * tag 'linux-kselftest-next-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (24 commits) Makefile: replace headers_install with headers for kselftest selftests/landlock: drop deprecated headers dependency selftests: timers: clocksource-switch: adapt to kselftest framework selftests: timers: clocksource-switch: add 'runtime' command line parameter selftests: timers: clocksource-switch: add command line switch to skip sanity check selftests: timers: clocksource-switch: sort includes selftests: timers: clocksource-switch: fix passing errors from child selftests: timers: inconsistency-check: adapt to kselftest framework selftests: timers: nanosleep: adapt to kselftest framework selftests: timers: fix declarations of main() selftests: timers: valid-adjtimex: build fix for newer toolchains Makefile: add headers_install to kselftest targets selftests: drop KSFT_KHDR_INSTALL make target selftests: stop using KSFT_KHDR_INSTALL selftests: drop khdr make target selftests: drivers/dma-buf: Improve message in selftest summary selftests/kcmp: Make the test output consistent and clear selftests:timers: globals don't need initialization to 0 selftests/drivers/gpu: Add error messages to drm_mm.sh selftests/tpm2: increase timeout for kselftests ...
2 parents 665fe72 + 4062eba commit e05d5b9

File tree

30 files changed

+111
-145
lines changed

30 files changed

+111
-145
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,10 +1348,10 @@ tools/%: FORCE
13481348
# Kernel selftest
13491349

13501350
PHONY += kselftest
1351-
kselftest:
1351+
kselftest: headers
13521352
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests run_tests
13531353

1354-
kselftest-%: FORCE
1354+
kselftest-%: headers FORCE
13551355
$(Q)$(MAKE) -C $(srctree)/tools/testing/selftests $*
13561356

13571357
PHONY += kselftest-merge

tools/testing/selftests/Makefile

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,38 +143,14 @@ endif
143143
# Prepare for headers install
144144
include $(top_srcdir)/scripts/subarch.include
145145
ARCH ?= $(SUBARCH)
146-
export KSFT_KHDR_INSTALL_DONE := 1
147146
export BUILD
148147
export KHDR_INCLUDES
149148

150149
# set default goal to all, so make without a target runs all, even when
151150
# all isn't the first target in the file.
152151
.DEFAULT_GOAL := all
153152

154-
# Install headers here once for all tests. KSFT_KHDR_INSTALL_DONE
155-
# is used to avoid running headers_install from lib.mk.
156-
# Invoke headers install with --no-builtin-rules to avoid circular
157-
# dependency in "make kselftest" case. In this case, second level
158-
# make inherits builtin-rules which will use the rule generate
159-
# Makefile.o and runs into
160-
# "Circular Makefile.o <- prepare dependency dropped."
161-
# and headers_install fails and test compile fails.
162-
#
163-
# O= KBUILD_OUTPUT cases don't run into this error, since main Makefile
164-
# invokes them as sub-makes and --no-builtin-rules is not necessary,
165-
# but doesn't cause any failures. Keep it simple and use the same
166-
# flags in both cases.
167-
# Local build cases: "make kselftest", "make -C" - headers are installed
168-
# in the default INSTALL_HDR_PATH usr/include.
169-
khdr:
170-
ifeq (1,$(DEFAULT_INSTALL_HDR_PATH))
171-
$(MAKE) --no-builtin-rules ARCH=$(ARCH) -C $(top_srcdir) headers_install
172-
else
173-
$(MAKE) --no-builtin-rules INSTALL_HDR_PATH=$(abs_objtree)/usr \
174-
ARCH=$(ARCH) -C $(top_srcdir) headers_install
175-
endif
176-
177-
all: khdr
153+
all:
178154
@ret=1; \
179155
for TARGET in $(TARGETS); do \
180156
BUILD_TARGET=$$BUILD/$$TARGET; \
@@ -253,7 +229,7 @@ ifdef INSTALL_PATH
253229
for TARGET in $(TARGETS); do \
254230
BUILD_TARGET=$$BUILD/$$TARGET; \
255231
[ ! -d $(INSTALL_PATH)/$$TARGET ] && echo "Skipping non-existent dir: $$TARGET" && continue; \
256-
echo -n "Emit Tests for $$TARGET\n"; \
232+
echo -ne "Emit Tests for $$TARGET\n"; \
257233
$(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \
258234
-C $$TARGET emit_tests >> $(TEST_LIST); \
259235
done;
@@ -274,4 +250,4 @@ clean:
274250
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean;\
275251
done;
276252

277-
.PHONY: khdr all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean gen_tar
253+
.PHONY: all run_tests hotplug run_hotplug clean_hotplug run_pstore_crash install clean gen_tar

tools/testing/selftests/arm64/mte/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ ifeq ($(mte_cc_support),1)
2222
TEST_GEN_PROGS := $(PROGS)
2323

2424
# Get Kernel headers installed and use them.
25-
KSFT_KHDR_INSTALL := 1
2625
else
2726
$(warning compiler "$(CC)" does not support the ARMv8.5 MTE extension.)
2827
$(warning test program "mte" will not be created.)

tools/testing/selftests/arm64/signal/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ PROGS := $(patsubst %.c,%,$(SRCS))
1111
TEST_GEN_PROGS := $(notdir $(PROGS))
1212

1313
# Get Kernel headers installed and use them.
14-
KSFT_KHDR_INSTALL := 1
1514

1615
# Including KSFT lib.mk here will also mangle the TEST_GEN_PROGS list
1716
# to account for any OUTPUT target-dirs optionally provided by

tools/testing/selftests/arm64/signal/test_signals.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
#include <ucontext.h>
1010

1111
/*
12-
* Using ARCH specific and sanitized Kernel headers installed by KSFT
13-
* framework since we asked for it by setting flag KSFT_KHDR_INSTALL
14-
* in our Makefile.
12+
* Using ARCH specific and sanitized Kernel headers from the tree.
1513
*/
1614
#include <asm/ptrace.h>
1715
#include <asm/hwcap.h>

tools/testing/selftests/damon/_chk_dependency.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,13 @@ do
2626
exit 1
2727
fi
2828
done
29+
30+
permission_error="Operation not permitted"
31+
for f in attrs target_ids monitor_on
32+
do
33+
status=$( cat "$DBGFS/$f" 2>&1 )
34+
if [ "${status#*$permission_error}" != "$status" ]; then
35+
echo "Permission for reading $DBGFS/$f denied; maybe secureboot enabled?"
36+
exit $ksft_skip
37+
fi
38+
done

tools/testing/selftests/drivers/dma-buf/udmabuf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ int main(int argc, char *argv[])
3232

3333
devfd = open("/dev/udmabuf", O_RDWR);
3434
if (devfd < 0) {
35-
printf("%s: [skip,no-udmabuf]\n", TEST_PREFIX);
35+
printf("%s: [skip,no-udmabuf: Unable to access DMA buffer device file]\n",
36+
TEST_PREFIX);
3637
exit(77);
3738
}
3839

tools/testing/selftests/drivers/gpu/drm_mm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
# Runs API tests for struct drm_mm (DRM range manager)
44

55
if ! /sbin/modprobe -n -q test-drm_mm; then
6-
echo "drivers/gpu/drm_mm: [skip]"
6+
echo "drivers/gpu/drm_mm: module test-drm_mm is not found in /lib/modules/`uname -r` [skip]"
77
exit 77
88
fi
99

1010
if /sbin/modprobe -q test-drm_mm; then
1111
/sbin/modprobe -q -r test-drm_mm
1212
echo "drivers/gpu/drm_mm: ok"
1313
else
14-
echo "drivers/gpu/drm_mm: [FAIL]"
14+
echo "drivers/gpu/drm_mm: module test-drm_mm could not be removed [FAIL]"
1515
exit 1
1616
fi

tools/testing/selftests/drivers/s390x/uvdevice/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ else
1111
TEST_GEN_PROGS := test_uvdevice
1212

1313
top_srcdir ?= ../../../../../..
14-
KSFT_KHDR_INSTALL := 1
1514
khdr_dir = $(top_srcdir)/usr/include
1615
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
1716

tools/testing/selftests/futex/functional/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ TEST_GEN_FILES := \
2222
TEST_PROGS := run.sh
2323

2424
top_srcdir = ../../../../..
25-
KSFT_KHDR_INSTALL := 1
2625
DEFAULT_INSTALL_HDR_PATH := 1
2726
include ../../lib.mk
2827

0 commit comments

Comments
 (0)