linux-kselftest-5.7-rc3

This kselftest update for Linux 5.7-rc3 consists of fixes to runner
 scripts and individual test run-time bugs. Includes fixes to tpm2
 and memfd test run-time regressions.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPZKym/RZuOCGeA/kCwJExA0NQxwFAl6gcfsACgkQCwJExA0N
 QxxmFQ/+NCoDIatTBqn6sFWC17RuwYJQDkcuOF1NM45IXUGt0URUIxRbmM0DlDJ6
 Y3HUCFjXdTTzS4cC/8lIFIH7Gf4NTFswviODC9qfeE9zi4BXwG9CyJZpOsPhlo5T
 aZsjTVgJfeN4EgjXKn/9MWCPE1u3pgMPUfZRSsnQyEjT0tgGYChq/rADc8Y1Mgax
 9GnOf9QoZ21gZhWRJVxwPVDDik4OU6GhmILee2GULtl2O/tecnsbSisnQKS/WHoD
 qCnNfxuaZAlpO7Ma+ywtxURuXspE9nWnsJmckCQ018WvpN26LymyRmAsDul0R2oU
 nTk3YhiMo8TB6nFq1BEE+ti3oi7dN3DndAM25++PjxMyFKh4UVvaWw6V38ITVvNd
 e5zS57CmYEA6gOdN05xf0Uk/mSfdbsdIPGsiql49YoFjrXNzaWxEE+kkgxul+wht
 GjBcJwxDPwfL7GQ+SgcxANffIwn2N4/welPAW2dc5Nhx5mGZZMBEfKZWhq/vwXn4
 mmmr2oX3V9tj0Hlo8g8jgSRknRFwMOjlyvtNdjDOrqDsumPDueWUuJMX0rGiDJU/
 W8w3mjrI5WdPbH7qKG/xWARhKxVhSkSh+TtNjz5Rj4oQ2A70/mxlCp9R+PmZlEqJ
 OjorLur3J88J4MdSSiQJvInJPQ5Bd80v0oz/ZXlQVs1S6zzQHyk=
 =6l5V
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2020-04-22 10:47:49 -07:00
commit c578ddb39e
10 changed files with 22 additions and 34 deletions

View File

@ -11,5 +11,6 @@ CONFIG_PREEMPTIRQ_DELAY_TEST=m
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
CONFIG_SAMPLES=y
CONFIG_SAMPLE_FTRACE_DIRECT=m
CONFIG_SAMPLE_TRACE_PRINTK=m
CONFIG_KALLSYMS_ALL=y

View File

@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque)
for (kern_id = 0; kern_id < 256; kern_id++) {
ret = msgctl(kern_id, MSG_STAT, &ds);
if (ret < 0) {
if (errno == -EINVAL)
if (errno == EINVAL)
continue;
printf("Failed to get stats for IPC queue with id %d\n",
kern_id);

View File

@ -33,7 +33,7 @@ tap_timeout()
{
# Make sure tests will time out if utility is available.
if [ -x /usr/bin/timeout ] ; then
/usr/bin/timeout "$kselftest_timeout" "$1"
/usr/bin/timeout --foreground "$kselftest_timeout" "$1"
else
"$1"
fi

View File

@ -705,7 +705,7 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
/* Sanity check handler execution environment. */
if (!t) {
fprintf(TH_LOG_STREAM,
"no active test in SIGARLM handler!?\n");
"no active test in SIGALRM handler!?\n");
abort();
}
if (sig != SIGALRM || sig != info->si_signo) {
@ -731,7 +731,7 @@ void __wait_for_test(struct __test_metadata *t)
if (sigaction(SIGALRM, &action, &saved_action)) {
t->passed = 0;
fprintf(TH_LOG_STREAM,
"%s: unable to install SIGARLM handler\n",
"%s: unable to install SIGALRM handler\n",
t->name);
return;
}
@ -743,7 +743,7 @@ void __wait_for_test(struct __test_metadata *t)
if (sigaction(SIGALRM, &saved_action, NULL)) {
t->passed = 0;
fprintf(TH_LOG_STREAM,
"%s: unable to uninstall SIGARLM handler\n",
"%s: unable to uninstall SIGALRM handler\n",
t->name);
return;
}

View File

@ -4,8 +4,9 @@ CFLAGS += -I../../../../include/uapi/
CFLAGS += -I../../../../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_GEN_FILES := fuse_test fuse_mnt
fuse_mnt.o: CFLAGS += $(shell pkg-config fuse --cflags)

View File

@ -2803,12 +2803,13 @@ TEST(syscall_restart)
offsetof(struct seccomp_data, nr)),
#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
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 5, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 4, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 3, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_nanosleep, 4, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_read, 6, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_exit, 5, 0),
BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __NR_rt_sigreturn, 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),
/* Allow __NR_write for easy logging. */
@ -2895,7 +2896,8 @@ TEST(syscall_restart)
ASSERT_EQ(PTRACE_EVENT_SECCOMP, (status >> 16));
ASSERT_EQ(0, ptrace(PTRACE_GETEVENTMSG, child_pid, NULL, &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. */
ASSERT_EQ(0, ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &info));

View File

@ -1,17 +1,8 @@
#!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
self.flags = flags
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
if [ -f /dev/tpm0 ] ; then
python -m unittest -v tpm2_tests.SmokeTest
python -m unittest -v tpm2_tests.AsyncTest
else
exit $ksft_skip
fi
python -m unittest -v tpm2_tests.SmokeTest
python -m unittest -v tpm2_tests.AsyncTest
CLEAR_CMD=$(which tpm2_clear)
if [ -n $CLEAR_CMD ]; then

View File

@ -1,11 +1,4 @@
#!/bin/bash
# SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
# Kselftest framework requirement - SKIP code is 4.
ksft_skip=4
if [ -f /dev/tpmrm0 ] ; then
python -m unittest -v tpm2_tests.SpaceTest
else
exit $ksft_skip
fi
python -m unittest -v tpm2_tests.SpaceTest

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
# Makefile for vm selftests
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)
LDLIBS = -lrt
@ -20,7 +20,7 @@ TEST_GEN_FILES += thuge-gen
TEST_GEN_FILES += transhuge-stress
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 += virtual_address_range
TEST_GEN_FILES += write_to_hugetlbfs

View File

@ -59,7 +59,7 @@ else
fi
#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
ARCH=`uname -m 2>/dev/null | sed -e 's/aarch64.*/arm64/'`
fi