Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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"

+46 -12
+13 -5
tools/testing/selftests/cpufreq/cpufreq.sh
··· 52 52 for file in $files; do 53 53 if [ -f $1/$file ]; then 54 54 printf "$file:" 55 - cat $1/$file 55 + #file is readable ? 56 + local rfile=$(ls -l $1/$file | awk '$1 ~ /^.*r.*/ { print $NF; }') 57 + 58 + if [ ! -z $rfile ]; then 59 + cat $1/$file 60 + else 61 + printf "$file is not readable\n" 62 + fi 56 63 else 57 64 printf "\n" 58 65 read_cpufreq_files_in_dir "$1/$file" ··· 90 83 91 84 for file in $files; do 92 85 if [ -f $1/$file ]; then 93 - # file is writable ? 94 - local wfile=$(ls -l $1/$file | awk '$1 ~ /^.*w.*/ { print $NF; }') 86 + # file is readable and writable ? 87 + local rwfile=$(ls -l $1/$file | awk '$1 ~ /^.*rw.*/ { print $NF; }') 95 88 96 - if [ ! -z $wfile ]; then 89 + if [ ! -z $rwfile ]; then 97 90 # scaling_setspeed is a special file and we 98 91 # should skip updating it 99 92 if [ $file != "scaling_setspeed" ]; then ··· 251 244 printf "Failed to suspend using RTC wake alarm\n" 252 245 return 1 253 246 fi 247 + else 248 + echo $filename > $SYSFS/power/state 254 249 fi 255 250 256 - echo $filename > $SYSFS/power/state 257 251 printf "Came out of $1\n" 258 252 259 253 printf "Do basic tests after finishing $1 to verify cpufreq state\n\n"
+1 -1
tools/testing/selftests/ftrace/Makefile
··· 6 6 TEST_FILES := test.d settings 7 7 EXTRA_CLEAN := $(OUTPUT)/logs/* 8 8 9 - TEST_GEN_PROGS = poll 9 + TEST_GEN_FILES := poll 10 10 11 11 include ../lib.mk
+1 -1
tools/testing/selftests/perf_events/watermark_signal.c
··· 75 75 if (waitpid(child, &child_status, WSTOPPED) != child || 76 76 !(WIFSTOPPED(child_status) && WSTOPSIG(child_status) == SIGSTOP)) { 77 77 fprintf(stderr, 78 - "failed to sycnhronize with child errno=%d status=%x\n", 78 + "failed to synchronize with child errno=%d status=%x\n", 79 79 errno, 80 80 child_status); 81 81 goto cleanup;
+1
tools/testing/selftests/pid_namespace/pid_max.c
··· 10 10 #include <stdlib.h> 11 11 #include <string.h> 12 12 #include <syscall.h> 13 + #include <sys/mount.h> 13 14 #include <sys/wait.h> 14 15 15 16 #include "../kselftest_harness.h"
+8 -1
tools/testing/selftests/run_kselftest.sh
··· 3 3 # 4 4 # Run installed kselftest tests. 5 5 # 6 - BASE_DIR=$(realpath $(dirname $0)) 6 + 7 + # Fallback to readlink if realpath is not available 8 + if which realpath > /dev/null; then 9 + BASE_DIR=$(realpath $(dirname $0)) 10 + else 11 + BASE_DIR=$(readlink -f $(dirname $0)) 12 + fi 13 + 7 14 cd $BASE_DIR 8 15 TESTS="$BASE_DIR"/kselftest-list.txt 9 16 if [ ! -r "$TESTS" ] ; then
+3 -1
tools/testing/selftests/timens/clock_nanosleep.c
··· 38 38 return NULL; 39 39 } 40 40 41 - int run_test(int clockid, int abs) 41 + static int run_test(int clockid, int abs) 42 42 { 43 43 struct timespec now = {}, rem; 44 44 struct thread_args args = { .now = &now, .rem = &rem, .clockid = clockid}; ··· 114 114 int main(int argc, char *argv[]) 115 115 { 116 116 int ret, nsfd; 117 + 118 + ksft_print_header(); 117 119 118 120 nscheck(); 119 121
+2
tools/testing/selftests/timens/exec.c
··· 36 36 return 0; 37 37 } 38 38 39 + ksft_print_header(); 40 + 39 41 nscheck(); 40 42 41 43 ksft_set_plan(1);
+2
tools/testing/selftests/timens/futex.c
··· 66 66 pid_t pid; 67 67 struct timespec mtime_now; 68 68 69 + ksft_print_header(); 70 + 69 71 nscheck(); 70 72 71 73 ksft_set_plan(2);
+2
tools/testing/selftests/timens/gettime_perf.c
··· 67 67 time_t offset = 10; 68 68 int nsfd; 69 69 70 + ksft_print_header(); 71 + 70 72 ksft_set_plan(8); 71 73 72 74 fill_function_pointers();
+2
tools/testing/selftests/timens/procfs.c
··· 180 180 { 181 181 int ret = 0; 182 182 183 + ksft_print_header(); 184 + 183 185 nscheck(); 184 186 185 187 ksft_set_plan(2);
+2
tools/testing/selftests/timens/timens.c
··· 151 151 time_t offset; 152 152 int ret = 0; 153 153 154 + ksft_print_header(); 155 + 154 156 nscheck(); 155 157 156 158 check_supported_timers();
+3 -1
tools/testing/selftests/timens/timer.c
··· 15 15 #include "log.h" 16 16 #include "timens.h" 17 17 18 - int run_test(int clockid, struct timespec now) 18 + static int run_test(int clockid, struct timespec now) 19 19 { 20 20 struct itimerspec new_value; 21 21 long long elapsed; ··· 74 74 char buf[4096]; 75 75 pid_t pid; 76 76 struct timespec btime_now, mtime_now; 77 + 78 + ksft_print_header(); 77 79 78 80 nscheck(); 79 81
+4 -2
tools/testing/selftests/timens/timerfd.c
··· 15 15 #include "log.h" 16 16 #include "timens.h" 17 17 18 - static int tclock_gettime(clock_t clockid, struct timespec *now) 18 + static int tclock_gettime(clockid_t clockid, struct timespec *now) 19 19 { 20 20 if (clockid == CLOCK_BOOTTIME_ALARM) 21 21 clockid = CLOCK_BOOTTIME; 22 22 return clock_gettime(clockid, now); 23 23 } 24 24 25 - int run_test(int clockid, struct timespec now) 25 + static int run_test(int clockid, struct timespec now) 26 26 { 27 27 struct itimerspec new_value; 28 28 long long elapsed; ··· 81 81 char buf[4096]; 82 82 pid_t pid; 83 83 struct timespec btime_now, mtime_now; 84 + 85 + ksft_print_header(); 84 86 85 87 nscheck(); 86 88
+2
tools/testing/selftests/timens/vfork_exec.c
··· 91 91 return check("child after exec", &now); 92 92 } 93 93 94 + ksft_print_header(); 95 + 94 96 nscheck(); 95 97 96 98 ksft_set_plan(4);