Commit 25b20ae8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux-kselftest-fixes-5.17-rc3' of...

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

Pull Kselftest fixes from Shuah Khan:
 "Important fixes to several tests and documentation clarification on
  running mainline kselftest on stable releases. A few notable fixes:

   - fix kselftest run hang due to child processes that haven't been
     terminated. Fix signals all child processes

   - fix false pass/fail results from vdso_test_abi, openat2, mincore

   - build failures when using -j (multiple jobs) option

   - exec test build failure due to incorrect build rule for a run-time
     created "pipe"

   - zram test fixes related to interaction with zram-generator to make
     sure zram test to coordinate deleted with zram-generator

   - zram test compression ratio calculation fix and skipping
     max_comp_streams.

   - increasing rtc test timeout

   - cpufreq test to write test results to stdout which will necessary
     on automated test systems"

* tag 'linux-kselftest-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kselftest: Fix vdso_test_abi return status
  selftests: skip mincore.check_file_mmap when fs lacks needed support
  selftests: openat2: Skip testcases that fail with EOPNOTSUPP
  selftests: openat2: Add missing dependency in Makefile
  selftests: openat2: Print also errno in failure messages
  selftests: futex: Use variable MAKE instead of make
  selftests/exec: Remove pipe from TEST_GEN_FILES
  selftests/zram: Adapt the situation that /dev/zram0 is being used
  selftests/zram01.sh: Fix compression ratio calculation
  selftests/zram: Skip max_comp_streams interface on newer kernel
  docs/kselftest: clarify running mainline tests on stables
  kselftest: signal all child processes
  selftests: cpufreq: Write test output to stdout as well
  selftests: rtc: Increase test timeout so that all tests run
parents 1f2cfdd3 ec049891
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -7,6 +7,14 @@ directory. These are intended to be small tests to exercise individual code
paths in the kernel. Tests are intended to be run after building, installing
and booting a kernel.

Kselftest from mainline can be run on older stable kernels. Running tests
from mainline offers the best coverage. Several test rings run mainline
kselftest suite on stable releases. The reason is that when a new test
gets added to test existing code to regression test a bug, we should be
able to run that test on an older kernel. Hence, it is important to keep
code that can still test an older kernel and make sure it skips the test
gracefully on newer releases.

You can find additional information on Kselftest framework, how to
write new tests using the framework on Kselftest wiki:

+1 −1
Original line number Diff line number Diff line
@@ -194,5 +194,5 @@ prerequisite

# Run requested functions
clear_dumps $OUTFILE
do_test >> $OUTFILE.txt
do_test | tee -a $OUTFILE.txt
dmesg_dumps $OUTFILE
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ CFLAGS += -D_GNU_SOURCE

TEST_PROGS := binfmt_script non-regular
TEST_GEN_PROGS := execveat load_address_4096 load_address_2097152 load_address_16777216
TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir pipe
TEST_GEN_FILES := execveat.symlink execveat.denatured script subdir
# Makefile is a run-time dependency, since it's accessed by the execveat test
TEST_FILES := Makefile

+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ all:
	@for DIR in $(SUBDIRS); do		\
		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
		mkdir $$BUILD_TARGET  -p;	\
		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
		if [ -e $$DIR/$(TEST_PROGS) ]; then \
			rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
		fi \
@@ -32,6 +32,6 @@ override define CLEAN
	@for DIR in $(SUBDIRS); do		\
		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
		mkdir $$BUILD_TARGET  -p;	\
		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
	done
endef
+3 −1
Original line number Diff line number Diff line
@@ -877,7 +877,8 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext)
	}

	t->timed_out = true;
	kill(t->pid, SIGKILL);
	// signal process group
	kill(-(t->pid), SIGKILL);
}

void __wait_for_test(struct __test_metadata *t)
@@ -987,6 +988,7 @@ void __run_test(struct __fixture_metadata *f,
		ksft_print_msg("ERROR SPAWNING TEST CHILD\n");
		t->passed = 0;
	} else if (t->pid == 0) {
		setpgrp();
		t->fn(t, variant);
		if (t->skip)
			_exit(255);
Loading