Commit c578ddb3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'linux-kselftest-5.7-rc3' of...

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
parents 18bf3408 b87080ea
...@@ -11,5 +11,6 @@ CONFIG_PREEMPTIRQ_DELAY_TEST=m ...@@ -11,5 +11,6 @@ CONFIG_PREEMPTIRQ_DELAY_TEST=m
CONFIG_MODULES=y CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_UNLOAD=y
CONFIG_SAMPLES=y CONFIG_SAMPLES=y
CONFIG_SAMPLE_FTRACE_DIRECT=m
CONFIG_SAMPLE_TRACE_PRINTK=m CONFIG_SAMPLE_TRACE_PRINTK=m
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
...@@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque) ...@@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque)
for (kern_id = 0; kern_id < 256; kern_id++) { for (kern_id = 0; kern_id < 256; kern_id++) {
ret = msgctl(kern_id, MSG_STAT, &ds); ret = msgctl(kern_id, MSG_STAT, &ds);
if (ret < 0) { if (ret < 0) {
if (errno == -EINVAL) if (errno == EINVAL)
continue; continue;
printf("Failed to get stats for IPC queue with id %d\n", printf("Failed to get stats for IPC queue with id %d\n",
kern_id); kern_id);
......
...@@ -33,7 +33,7 @@ tap_timeout() ...@@ -33,7 +33,7 @@ tap_timeout()
{ {
# Make sure tests will time out if utility is available. # Make sure tests will time out if utility is available.
if [ -x /usr/bin/timeout ] ; then if [ -x /usr/bin/timeout ] ; then
/usr/bin/timeout "$kselftest_timeout" "$1" /usr/bin/timeout --foreground "$kselftest_timeout" "$1"
else else
"$1" "$1"
fi fi
......
...@@ -705,7 +705,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext) ...@@ -705,7 +705,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
/* Sanity check handler execution environment. */ /* Sanity check handler execution environment. */
if (!t) { if (!t) {
fprintf(TH_LOG_STREAM, fprintf(TH_LOG_STREAM,
"no active test in SIGARLM handler!?\n"); "no active test in SIGALRM handler!?\n");
abort(); abort();
} }
if (sig != SIGALRM || sig != info->si_signo) { if (sig != SIGALRM || sig != info->si_signo) {
...@@ -731,7 +731,7 @@ void __wait_for_test(struct __test_metadata *t) ...@@ -731,7 +731,7 @@ void __wait_for_test(struct __test_metadata *t)
if (sigaction(SIGALRM, &action, &saved_action)) { if (sigaction(SIGALRM, &action, &saved_action)) {
t->passed = 0; t->passed = 0;
fprintf(TH_LOG_STREAM, fprintf(TH_LOG_STREAM,
"%s: unable to install SIGARLM handler\n", "%s: unable to install SIGALRM handler\n",
t->name); t->name);
return; return;
} }
...@@ -743,7 +743,7 @@ void __wait_for_test(struct __test_metadata *t) ...@@ -743,7 +743,7 @@ void __wait_for_test(struct __test_metadata *t)
if (sigaction(SIGALRM, &saved_action, NULL)) { if (sigaction(SIGALRM, &saved_action, NULL)) {
t->passed = 0; t->passed = 0;
fprintf(TH_LOG_STREAM, fprintf(TH_LOG_STREAM,
"%s: unable to uninstall SIGARLM handler\n", "%s: unable to uninstall SIGALRM handler\n",
t->name); t->name);
return; return;
} }
......
...@@ -4,8 +4,9 @@ CFLAGS += -I../../../../include/uapi/ ...@@ -4,8 +4,9 @@ CFLAGS += -I../../../../include/uapi/
CFLAGS += -I../../../../include/ CFLAGS += -I../../../../include/
CFLAGS += -I../../../../usr/include/ CFLAGS += -I../../../../usr/include/
TEST_GEN_PROGS := memfd_test fuse_test fuse_mnt TEST_GEN_PROGS := memfd_test
TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh TEST_PROGS := run_fuse_test.sh run_hugetlbfs_test.sh
TEST_GEN_FILES := fuse_test fuse_mnt
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags) fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)
......
...@@ -2803,12 +2803,13 @@ TEST(syscall_restart) ...@@ -2803,12 +2803,13 @@ TEST(syscall_restart)
offsetof(struct seccomp_data, nr)), offsetof(struct seccomp_data, nr)),
#ifdef __NR_sigreturn #ifdef __NR_sigreturn
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_sigreturn, 6, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_sigreturn, 7, 0),
#endif #endif
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 5, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 6, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 4, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 5, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 3, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 4, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 4, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 5, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_clock_nanosleep, 4, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_restart_syscall, 4, 0), BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_restart_syscall, 4, 0),
/* Allow __NR_write for easy logging. */ /* Allow __NR_write for easy logging. */
...@@ -2895,7 +2896,8 @@ TEST(syscall_restart) ...@@ -2895,7 +2896,8 @@ TEST(syscall_restart)
ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16)); ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16));
ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &msg)); ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &msg));
ASSERT_EQ(0x100, msg); ASSERT_EQ(0x100, msg);
EXPECT_EQ(__NR_nanosleep, get_syscall(_metadata, child_pid)); ret = get_syscall(_metadata, child_pid);
EXPECT_TRUE(ret == __NR_nanosleep || ret == __NR_clock_nanosleep);
/* Might as well check siginfo for sanity while we're here. */ /* Might as well check siginfo for sanity while we're here. */
ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info)); ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));
......
#!/bin/bash #!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
self.flags = flags
# Kselftest framework requirement - SKIP code is 4. python -m unittest -v tpm2_tests.SmokeTest
ksft_skip=4 python -m unittest -v tpm2_tests.AsyncTest
if [ -f /dev/tpm0 ] ; then
python -m unittest -v tpm2_tests.SmokeTest
python -m unittest -v tpm2_tests.AsyncTest
else
exit $ksft_skip
fi
CLEAR_CMD=$(which tpm2_clear) CLEAR_CMD=$(which tpm2_clear)
if [ -n $CLEAR_CMD ]; then if [ -n $CLEAR_CMD ]; then
......
#!/bin/bash #!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) # SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
# Kselftest framework requirement - SKIP code is 4. python -m unittest -v tpm2_tests.SpaceTest
ksft_skip=4
if [ -f /dev/tpmrm0 ] ; then
python -m unittest -v tpm2_tests.SpaceTest
else
exit $ksft_skip
fi
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Makefile for vm selftests # Makefile for vm selftests
uname_M := $(shell uname -m 2>/dev/null || echo not) uname_M := $(shell uname -m 2>/dev/null || echo not)
ARCH ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/') MACHINE ?= $(shell echo $(uname_M) | sed -e 's/aarch64.*/arm64/')
CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS) CFLAGS = -Wall -I ../../../../usr/include $(EXTRA_CFLAGS)
LDLIBS = -lrt LDLIBS = -lrt
...@@ -20,7 +20,7 @@ TEST_GEN_FILES += thuge-gen ...@@ -20,7 +20,7 @@ TEST_GEN_FILES += thuge-gen
TEST_GEN_FILES += transhuge-stress TEST_GEN_FILES += transhuge-stress
TEST_GEN_FILES += userfaultfd TEST_GEN_FILES += userfaultfd
ifneq (,$(filter $(ARCH),arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64)) ifneq (,$(filter $(MACHINE),arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64))
TEST_GEN_FILES += va_128TBswitch TEST_GEN_FILES += va_128TBswitch
TEST_GEN_FILES += virtual_address_range TEST_GEN_FILES += virtual_address_range
TEST_GEN_FILES += write_to_hugetlbfs TEST_GEN_FILES += write_to_hugetlbfs
......
...@@ -59,7 +59,7 @@ else ...@@ -59,7 +59,7 @@ else
fi fi
#filter 64bit architectures #filter 64bit architectures
ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 riscv64 s390x sh64 sparc64 x86_64" ARCH64STR="arm64 ia64 mips64 parisc64 ppc64 ppc64le riscv64 s390x sh64 sparc64 x86_64"
if [ -z $ARCH ]; then if [ -z $ARCH ]; then
ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'` ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'`
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment