Commit 2d2435e1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'linux_kselftest-next-6.16-rc1' of...

Merge tag 'linux_kselftest-next-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:
 "Fixes:

   - cpufreq test to not double suspend in rtcwake case

   - compile error in pid_namespace test

   - run_kselftest.sh to use readlink if realpath is not available

   - cpufreq basic read and update testcases

   - ftrace to add poll to a gen_file so test can find it at run-time

   - spelling errors in perf_events test"

* tag 'linux_kselftest-next-6.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/run_kselftest.sh: Use readlink if realpath is not available
  selftests/timens: timerfd: Use correct clockid type in tclock_gettime()
  selftests/timens: Make run_tests() functions static
  selftests/timens: Print TAP headers
  selftests: pid_namespace: add missing sys/mount.h include in pid_max.c
  kselftest: cpufreq: Get rid of double suspend in rtcwake case
  selftests/cpufreq: Fix cpufreq basic read and update testcases
  selftests/ftrace: Convert poll to a gen_file
  selftests/perf_events: Fix spelling mistake "sycnhronize" -> "synchronize"
parents 07046958 1107dc4c
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -52,7 +52,14 @@ read_cpufreq_files_in_dir()
	for file in $files; do
		if [ -f $1/$file ]; then
			printf "$file:"
			#file is readable ?
			local rfile=$(ls -l $1/$file | awk '$1 ~ /^.*r.*/ { print $NF; }')

			if [ ! -z $rfile ]; then
				cat $1/$file
			else
				printf "$file is not readable\n"
			fi
		else
			printf "\n"
			read_cpufreq_files_in_dir "$1/$file"
@@ -83,10 +90,10 @@ update_cpufreq_files_in_dir()

	for file in $files; do
		if [ -f $1/$file ]; then
			# file is writable ?
			local wfile=$(ls -l $1/$file | awk '$1 ~ /^.*w.*/ { print $NF; }')
			# file is readable and writable ?
			local rwfile=$(ls -l $1/$file | awk '$1 ~ /^.*rw.*/ { print $NF; }')

			if [ ! -z $wfile ]; then
			if [ ! -z $rwfile ]; then
				# scaling_setspeed is a special file and we
				# should skip updating it
				if [ $file != "scaling_setspeed" ]; then
@@ -244,9 +251,10 @@ do_suspend()
					printf "Failed to suspend using RTC wake alarm\n"
					return 1
				fi
			else
				echo $filename > $SYSFS/power/state
			fi

			echo $filename > $SYSFS/power/state
			printf "Came out of $1\n"

			printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"
+1 −1
Original line number Diff line number Diff line
@@ -6,6 +6,6 @@ TEST_PROGS := ftracetest-ktap
TEST_FILES := test.d settings
EXTRA_CLEAN := $(OUTPUT)/logs/*

TEST_GEN_PROGS = poll
TEST_GEN_FILES := poll

include ../lib.mk
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ TEST(watermark_signal)
	if (waitpid(child, &child_status, WSTOPPED) != child ||
	    !(WIFSTOPPED(child_status) && WSTOPSIG(child_status) == SIGSTOP)) {
		fprintf(stderr,
			"failed to sycnhronize with child errno=%d status=%x\n",
			"failed to synchronize with child errno=%d status=%x\n",
			errno,
			child_status);
		goto cleanup;
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <syscall.h>
#include <sys/mount.h>
#include <sys/wait.h>

#include "../kselftest_harness.h"
+8 −1
Original line number Diff line number Diff line
@@ -3,7 +3,14 @@
#
# Run installed kselftest tests.
#

# Fallback to readlink if realpath is not available
if which realpath > /dev/null; then
        BASE_DIR=$(realpath $(dirname $0))
else
        BASE_DIR=$(readlink -f $(dirname $0))
fi

cd $BASE_DIR
TESTS="$BASE_DIR"/kselftest-list.txt
if [ ! -r "$TESTS" ] ; then
Loading