Skip to content

Commit c578ddb

Browse files
committed
Merge tag 'linux-kselftest-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
Pull kselftest fixes from Shuah Khan: "This consists of fixes to runner scripts and individual test run-time bugs. Includes fixes to tpm2 and memfd test run-time regressions" * tag 'linux-kselftest-5.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ipc: Fix test failure seen after initial test run Revert "Kernel selftests: tpm2: check for tpm support" selftests/ftrace: Add CONFIG_SAMPLE_FTRACE_DIRECT=m kconfig selftests/seccomp: allow clock_nanosleep instead of nanosleep kselftest/runner: allow to properly deliver signals to tests selftests/harness: fix spelling mistake "SIGARLM" -> "SIGALRM" selftests: Fix memfd test run-time regression selftests: vm: Fix 64-bit test builds for powerpc64le selftests: vm: Do not override definition of ARCH
2 parents 18bf340 + b87080e commit c578ddb

File tree

10 files changed

+22
-34
lines changed

10 files changed

+22
-34
lines changed

tools/testing/selftests/ftrace/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@ CONFIG_PREEMPTIRQ_DELAY_TEST=m
1111
CONFIG_MODULES=y
1212
CONFIG_MODULE_UNLOAD=y
1313
CONFIG_SAMPLES=y
14+
CONFIG_SAMPLE_FTRACE_DIRECT=m
1415
CONFIG_SAMPLE_TRACE_PRINTK=m
1516
CONFIG_KALLSYMS_ALL=y

tools/testing/selftests/ipc/msgque.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque)
137137
for (kern_id = 0; kern_id < 256; kern_id++) {
138138
ret = msgctl(kern_id, MSG_STAT, &ds);
139139
if (ret < 0) {
140-
if (errno == -EINVAL)
140+
if (errno == EINVAL)
141141
continue;
142142
printf("Failed to get stats for IPC queue with id %d\n",
143143
kern_id);

tools/testing/selftests/kselftest/runner.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tap_timeout()
3333
{
3434
# Make sure tests will time out if utility is available.
3535
if [ -x /usr/bin/timeout ] ; then
36-
/usr/bin/timeout "$kselftest_timeout" "$1"
36+
/usr/bin/timeout --foreground "$kselftest_timeout" "$1"
3737
else
3838
"$1"
3939
fi

tools/testing/selftests/kselftest_harness.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
705705
/* Sanity check handler execution environment. */
706706
if (!t) {
707707
fprintf(TH_LOG_STREAM,
708-
"no active test in SIGARLM handler!?\n");
708+
"no active test in SIGALRM handler!?\n");
709709
abort();
710710
}
711711
if (sig != SIGALRM || sig != info->si_signo) {
@@ -731,7 +731,7 @@ void __wait_for_test(struct __test_metadata *t)
731731
if (sigaction(SIGALRM, &action, &saved_action)) {
732732
t->passed = 0;
733733
fprintf(TH_LOG_STREAM,
734-
"%s: unable to install SIGARLM handler\n",
734+
"%s: unable to install SIGALRM handler\n",
735735
t->name);
736736
return;
737737
}
@@ -743,7 +743,7 @@ void __wait_for_test(struct __test_metadata *t)
743743
if (sigaction(SIGALRM, &saved_action, NULL)) {
744744
t->passed = 0;
745745
fprintf(TH_LOG_STREAM,
746-
"%s: unable to uninstall SIGARLM handler\n",
746+
"%s: unable to uninstall SIGALRM handler\n",
747747
t->name);
748748
return;
749749
}

tools/testing/selftests/memfd/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ CFLAGS += -I../../../../include/uapi/
44
CFLAGS += -I../../../../include/
55
CFLAGS += -I../../../../usr/include/
66

7-
TEST_GEN_PROGS := memfd_test fuse_test fuse_mnt
7+
TEST_GEN_PROGS := memfd_test
88
TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
9+
TEST_GEN_FILES := fuse_test fuse_mnt
910

1011
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
1112

tools/testing/selftests/seccomp/seccomp_bpf.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,12 +2803,13 @@ TEST(syscall_restart)
28032803
offsetof(struct seccomp_data, nr)),
28042804

28052805
#ifdef __NR_sigreturn
2806-
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_sigreturn, 6, 0),
2806+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_sigreturn, 7, 0),
28072807
#endif
2808-
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 5, 0),
2809-
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 4, 0),
2810-
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 3, 0),
2811-
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 4, 0),
2808+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 6, 0),
2809+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 5, 0),
2810+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 4, 0),
2811+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 5, 0),
2812+
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_clock_nanosleep, 4, 0),
28122813
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_restart_syscall, 4, 0),
28132814

28142815
/* Allow __NR_write for easy logging. */
@@ -2895,7 +2896,8 @@ TEST(syscall_restart)
28952896
ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16));
28962897
ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &msg));
28972898
ASSERT_EQ(0x100, msg);
2898-
EXPECT_EQ(__NR_nanosleep, get_syscall(_metadata, child_pid));
2899+
ret = get_syscall(_metadata, child_pid);
2900+
EXPECT_TRUE(ret == __NR_nanosleep || ret == __NR_clock_nanosleep);
28992901

29002902
/* Might as well check siginfo for sanity while we're here. */
29012903
ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));

tools/testing/selftests/tpm2/test_smoke.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
3-
self.flags = flags
43

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
4+
python -m unittest -v tpm2_tests.SmokeTest
5+
python -m unittest -v tpm2_tests.AsyncTest
156

167
CLEAR_CMD=$(which tpm2_clear)
178
if [ -n $CLEAR_CMD ]; then
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
#!/bin/bash
22
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
33

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
4+
python -m unittest -v tpm2_tests.SpaceTest

tools/testing/selftests/vm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
# Makefile for vm selftests
33
uname_M := $(shell uname -m 2>/dev/null || echo not)
4-
ARCH ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
4+
MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
55

66
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
77
LDLIBS = -lrt
@@ -20,7 +20,7 @@ TEST_GEN_FILES += thuge-gen
2020
TEST_GEN_FILES += transhuge-stress
2121
TEST_GEN_FILES += userfaultfd
2222

23-
ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64))
23+
ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64))
2424
TEST_GEN_FILES += va_128TBswitch
2525
TEST_GEN_FILES += virtual_address_range
2626
TEST_GEN_FILES += write_to_hugetlbfs

tools/testing/selftests/vm/run_vmtests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ else
5959
fi
6060

6161
#filter 64bit architectures
62-
ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64"
62+
ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64"
6363
if [ -z $ARCH ]; then
6464
ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'`
6565
fi

0 commit comments

Comments
 (0)