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.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest

Pull kselftest update from Shuah Khan:

- test coverage for dup_fd() failure handling in unshare_fd()

- new selftest for the acct() syscall

- basic uprobe testcase

- several small fixes and cleanups to existing tests

- user and strscpy removal as they became kunit tests

- fixes to build failures and warnings

* tag 'linux_kselftest-next-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (21 commits)
selftests: kselftest: Use strerror() on nolibc
selftests/timers: Remove unused NSEC_PER_SEC macro
selftests:resctrl: Fix build failure on archs without __cpuid_count()
selftests/ftrace: Fix eventfs ownership testcase to find mount point
selftests: filesystems: fix warn_unused_result build warnings
selftests:core: test coverage for dup_fd() failure handling in unshare_fd()
selftests/ftrace: Fix test to handle both old and new kernels
kselftest: timers: Fix const correctness
selftests/ftrace: Add required dependency for kprobe tests
selftests: rust: config: disable GCC_PLUGINS
selftests: rust: config: add trailing newline
tracing/selftests: Run the ownership test twice
selftests/uprobes: Add a basic uprobe testcase
selftests: harness: rename __constructor_order for clarification
selftests: harness: remove unneeded __constructor_order_last()
selftest: acct: Add selftest for the acct() syscall
selftests: lib: remove strscpy test
selftests: user: remove user suite
kselftest: cpufreq: Add RTC wakeup alarm
selftests/exec: Fix grammar in an error message.
...

+301 -110
+1 -1
tools/testing/selftests/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + TARGETS += acct 2 3 TARGETS += alsa 3 4 TARGETS += amd-pstate 4 5 TARGETS += arm64 ··· 110 109 TARGETS += tpm2 111 110 TARGETS += tty 112 111 TARGETS += uevent 113 - TARGETS += user 114 112 TARGETS += user_events 115 113 TARGETS += vDSO 116 114 TARGETS += mm
+3
tools/testing/selftests/acct/.gitignore
··· 1 + acct_syscall 2 + config 3 + process_log
+5
tools/testing/selftests/acct/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + TEST_GEN_PROGS := acct_syscall 3 + CFLAGS += -Wall 4 + 5 + include ../lib.mk
+78
tools/testing/selftests/acct/acct_syscall.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + /* kselftest for acct() system call 4 + * The acct() system call enables or disables process accounting. 5 + */ 6 + 7 + #include <stdio.h> 8 + #include <errno.h> 9 + #include <string.h> 10 + #include <sys/wait.h> 11 + 12 + #include "../kselftest.h" 13 + 14 + int main(void) 15 + { 16 + char filename[] = "process_log"; 17 + FILE *fp; 18 + pid_t child_pid; 19 + int sz; 20 + 21 + // Setting up kselftest framework 22 + ksft_print_header(); 23 + ksft_set_plan(1); 24 + 25 + // Check if test is run a root 26 + if (geteuid()) { 27 + ksft_test_result_skip("This test needs root to run!\n"); 28 + return 1; 29 + } 30 + 31 + // Create file to log closed processes 32 + fp = fopen(filename, "w"); 33 + 34 + if (!fp) { 35 + ksft_test_result_error("%s.\n", strerror(errno)); 36 + ksft_finished(); 37 + return 1; 38 + } 39 + 40 + acct(filename); 41 + 42 + // Handle error conditions 43 + if (errno) { 44 + ksft_test_result_error("%s.\n", strerror(errno)); 45 + fclose(fp); 46 + ksft_finished(); 47 + return 1; 48 + } 49 + 50 + // Create child process and wait for it to terminate. 51 + 52 + child_pid = fork(); 53 + 54 + if (child_pid < 0) { 55 + ksft_test_result_error("Creating a child process to log failed\n"); 56 + acct(NULL); 57 + return 1; 58 + } else if (child_pid > 0) { 59 + wait(NULL); 60 + fseek(fp, 0L, SEEK_END); 61 + sz = ftell(fp); 62 + 63 + acct(NULL); 64 + 65 + if (sz <= 0) { 66 + ksft_test_result_fail("Terminated child process not logged\n"); 67 + ksft_exit_fail(); 68 + return 1; 69 + } 70 + 71 + ksft_test_result_pass("Successfully logged terminated process.\n"); 72 + fclose(fp); 73 + ksft_exit_pass(); 74 + return 0; 75 + } 76 + 77 + return 1; 78 + }
+1 -1
tools/testing/selftests/core/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 CFLAGS += -g $(KHDR_INCLUDES) 3 3 4 - TEST_GEN_PROGS := close_range_test 4 + TEST_GEN_PROGS := close_range_test unshare_test 5 5 6 6 include ../lib.mk 7 7
+94
tools/testing/selftests/core/unshare_test.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #define _GNU_SOURCE 4 + #include <errno.h> 5 + #include <fcntl.h> 6 + #include <linux/kernel.h> 7 + #include <limits.h> 8 + #include <stdbool.h> 9 + #include <stdio.h> 10 + #include <stdlib.h> 11 + #include <string.h> 12 + #include <syscall.h> 13 + #include <unistd.h> 14 + #include <sys/resource.h> 15 + #include <linux/close_range.h> 16 + 17 + #include "../kselftest_harness.h" 18 + #include "../clone3/clone3_selftests.h" 19 + 20 + TEST(unshare_EMFILE) 21 + { 22 + pid_t pid; 23 + int status; 24 + struct __clone_args args = { 25 + .flags = CLONE_FILES, 26 + .exit_signal = SIGCHLD, 27 + }; 28 + int fd; 29 + ssize_t n, n2; 30 + static char buf[512], buf2[512]; 31 + struct rlimit rlimit; 32 + int nr_open; 33 + 34 + fd = open("/proc/sys/fs/nr_open", O_RDWR); 35 + ASSERT_GE(fd, 0); 36 + 37 + n = read(fd, buf, sizeof(buf)); 38 + ASSERT_GT(n, 0); 39 + ASSERT_EQ(buf[n - 1], '\n'); 40 + 41 + ASSERT_EQ(sscanf(buf, "%d", &nr_open), 1); 42 + 43 + ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlimit)); 44 + 45 + /* bump fs.nr_open */ 46 + n2 = sprintf(buf2, "%d\n", nr_open + 1024); 47 + lseek(fd, 0, SEEK_SET); 48 + write(fd, buf2, n2); 49 + 50 + /* bump ulimit -n */ 51 + rlimit.rlim_cur = nr_open + 1024; 52 + rlimit.rlim_max = nr_open + 1024; 53 + EXPECT_EQ(0, setrlimit(RLIMIT_NOFILE, &rlimit)) { 54 + lseek(fd, 0, SEEK_SET); 55 + write(fd, buf, n); 56 + exit(EXIT_FAILURE); 57 + } 58 + 59 + /* get a descriptor past the old fs.nr_open */ 60 + EXPECT_GE(dup2(2, nr_open + 64), 0) { 61 + lseek(fd, 0, SEEK_SET); 62 + write(fd, buf, n); 63 + exit(EXIT_FAILURE); 64 + } 65 + 66 + /* get descriptor table shared */ 67 + pid = sys_clone3(&args, sizeof(args)); 68 + EXPECT_GE(pid, 0) { 69 + lseek(fd, 0, SEEK_SET); 70 + write(fd, buf, n); 71 + exit(EXIT_FAILURE); 72 + } 73 + 74 + if (pid == 0) { 75 + int err; 76 + 77 + /* restore fs.nr_open */ 78 + lseek(fd, 0, SEEK_SET); 79 + write(fd, buf, n); 80 + /* ... and now unshare(CLONE_FILES) must fail with EMFILE */ 81 + err = unshare(CLONE_FILES); 82 + EXPECT_EQ(err, -1) 83 + exit(EXIT_FAILURE); 84 + EXPECT_EQ(errno, EMFILE) 85 + exit(EXIT_FAILURE); 86 + exit(EXIT_SUCCESS); 87 + } 88 + 89 + EXPECT_EQ(waitpid(pid, &status, 0), pid); 90 + EXPECT_EQ(true, WIFEXITED(status)); 91 + EXPECT_EQ(0, WEXITSTATUS(status)); 92 + } 93 + 94 + TEST_HARNESS_MAIN
+15
tools/testing/selftests/cpufreq/cpufreq.sh
··· 231 231 232 232 for i in `seq 1 $2`; do 233 233 printf "Starting $1\n" 234 + 235 + if [ "$3" = "rtc" ]; then 236 + if ! command -v rtcwake &> /dev/null; then 237 + printf "rtcwake could not be found, please install it.\n" 238 + return 1 239 + fi 240 + 241 + rtcwake -m $filename -s 15 242 + 243 + if [ $? -ne 0 ]; then 244 + printf "Failed to suspend using RTC wake alarm\n" 245 + return 1 246 + fi 247 + fi 248 + 234 249 echo $filename > $SYSFS/power/state 235 250 printf "Came out of $1\n" 236 251
+12 -1
tools/testing/selftests/cpufreq/main.sh
··· 24 24 [-t <basic: Basic cpufreq testing 25 25 suspend: suspend/resume, 26 26 hibernate: hibernate/resume, 27 + suspend_rtc: suspend/resume back using the RTC wakeup alarm, 28 + hibernate_rtc: hibernate/resume back using the RTC wakeup alarm, 27 29 modtest: test driver or governor modules. Only to be used with -d or -g options, 28 30 sptest1: Simple governor switch to produce lockdep. 29 31 sptest2: Concurrent governor switch to produce lockdep. ··· 78 76 helpme 79 77 ;; 80 78 81 - t) # --func_type (Function to perform: basic, suspend, hibernate, modtest, sptest1/2/3/4 (default: basic)) 79 + t) # --func_type (Function to perform: basic, suspend, hibernate, 80 + # suspend_rtc, hibernate_rtc, modtest, sptest1/2/3/4 (default: basic)) 82 81 FUNC=$OPTARG 83 82 ;; 84 83 ··· 123 120 "hibernate") 124 121 do_suspend "hibernate" 1 125 122 ;; 123 + 124 + "suspend_rtc") 125 + do_suspend "suspend" 1 rtc 126 + ;; 127 + 128 + "hibernate_rtc") 129 + do_suspend "hibernate" 1 rtc 130 + ;; 126 131 127 132 "modtest") 128 133 # Do we have modules in place?
-6
tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice.c
··· 257 257 att_inval_addr_test(&self->uvio_attest.meas_addr, _metadata, self); 258 258 } 259 259 260 - static void __attribute__((constructor)) __constructor_order_last(void) 261 - { 262 - if (!__constructor_order) 263 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 264 - } 265 - 266 260 int main(int argc, char **argv) 267 261 { 268 262 int fd = open(UV_PATH, O_ACCMODE);
+1 -1
tools/testing/selftests/exec/execveat.c
··· 117 117 } 118 118 if ((WEXITSTATUS(status) != expected_rc) && 119 119 (WEXITSTATUS(status) != expected_rc2)) { 120 - ksft_print_msg("child %d exited with %d not %d nor %d\n", 120 + ksft_print_msg("child %d exited with %d neither %d nor %d\n", 121 121 child, WEXITSTATUS(status), expected_rc, 122 122 expected_rc2); 123 123 ksft_test_result_fail("%s\n", test_name);
+5 -2
tools/testing/selftests/filesystems/statmount/statmount_test_ns.c
··· 319 319 * Tell our parent how many mounts we have, and then wait for it 320 320 * to tell us we're done. 321 321 */ 322 - write(child_ready_pipe[1], &nr_mounts, sizeof(nr_mounts)); 323 - read(parent_ready_pipe[0], &cval, sizeof(cval)); 322 + if (write(child_ready_pipe[1], &nr_mounts, sizeof(nr_mounts)) != 323 + sizeof(nr_mounts)) 324 + ret = NSID_ERROR; 325 + if (read(parent_ready_pipe[0], &cval, sizeof(cval)) != sizeof(cval)) 326 + ret = NSID_ERROR; 324 327 exit(NSID_PASS); 325 328 } 326 329
+32 -14
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
··· 6 6 original_owner=`stat -c "%u" .` 7 7 8 8 mount_point=`stat -c '%m' .` 9 + 10 + # If stat -c '%m' does not work (e.g. busybox) or failed, try to use the 11 + # current working directory (which should be a tracefs) as the mount point. 12 + if [ ! -d "$mount_point" ]; then 13 + if mount | grep -qw $PWD ; then 14 + mount_point=$PWD 15 + else 16 + # If PWD doesn't work, that is an environmental problem. 17 + exit_unresolved 18 + fi 19 + fi 20 + 9 21 mount_options=`mount | grep "$mount_point" | sed -e 's/.*(\(.*\)).*/\1/'` 10 22 11 23 # find another owner and group that is not the original ··· 95 83 done 96 84 } 97 85 98 - mount -o remount,"$new_options" . 86 + # Run the tests twice as leftovers can cause issues 87 + for loop in 1 2 ; do 99 88 100 - run_tests 89 + echo "Running iteration $loop" 101 90 102 - mount -o remount,"$mount_options" . 91 + mount -o remount,"$new_options" . 103 92 104 - for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do 105 - test "$d" $original_group 106 - done 93 + run_tests 94 + 95 + mount -o remount,"$mount_options" . 96 + 97 + for d in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable" $canary; do 98 + test "$d" $original_group 99 + done 107 100 108 101 # check instances as well 109 102 110 - chgrp $other_group instances 103 + chgrp $other_group instances 111 104 112 - instance="$(mktemp -u test-XXXXXX)" 105 + instance="$(mktemp -u test-XXXXXX)" 113 106 114 - mkdir instances/$instance 107 + mkdir instances/$instance 115 108 116 - cd instances/$instance 109 + cd instances/$instance 117 110 118 - run_tests 111 + run_tests 119 112 120 - cd ../.. 113 + cd ../.. 121 114 122 - rmdir instances/$instance 115 + rmdir instances/$instance 123 116 124 - chgrp $original_group instances 117 + chgrp $original_group instances 118 + done 125 119 126 120 exit 0
+26
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0 3 + # description: Generic dynamic event - add/remove/test uprobe events 4 + # requires: uprobe_events 5 + 6 + echo 0 > events/enable 7 + echo > dynamic_events 8 + 9 + echo 'cat /proc/$$/maps' | /bin/sh | \ 10 + grep "r-xp .*/bin/.*sh$" | \ 11 + awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events 12 + 13 + grep -q myevent uprobe_events 14 + test -d events/uprobes/myevent 15 + 16 + echo 1 > events/uprobes/myevent/enable 17 + echo 'ls' | /bin/sh > /dev/null 18 + echo 0 > events/uprobes/myevent/enable 19 + grep -q myevent trace 20 + 21 + echo "-:myevent" >> uprobe_events 22 + ! grep -q myevent uprobe_events 23 + 24 + echo > uprobe_events 25 + 26 + clear_trace
+8 -1
tools/testing/selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc
··· 19 19 20 20 FILTER=set_ftrace_filter 21 21 FUNC1="schedule" 22 - FUNC2="sched_tick" 22 + if grep '^sched_tick\b' available_filter_functions; then 23 + FUNC2="sched_tick" 24 + elif grep '^scheduler_tick\b' available_filter_functions; then 25 + FUNC2="scheduler_tick" 26 + else 27 + exit_unresolved 28 + fi 29 + 23 30 24 31 ALL_FUNCS="#### all functions enabled ####" 25 32
+1 -1
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # description: Kprobe event char type argument 4 - # requires: kprobe_events 4 + # requires: kprobe_events available_filter_functions 5 5 6 6 case `uname -m` in 7 7 x86_64)
+1 -1
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # description: Kprobe event string type argument 4 - # requires: kprobe_events 4 + # requires: kprobe_events available_filter_functions 5 5 6 6 case `uname -m` in 7 7 x86_64)
-6
tools/testing/selftests/hid/hid_bpf.c
··· 1357 1357 return 0; 1358 1358 } 1359 1359 1360 - static void __attribute__((constructor)) __constructor_order_last(void) 1361 - { 1362 - if (!__constructor_order) 1363 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 1364 - } 1365 - 1366 1360 int main(int argc, char **argv) 1367 1361 { 1368 1362 /* Use libbpf 1.0 API mode */
+2 -8
tools/testing/selftests/kselftest.h
··· 61 61 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) 62 62 #endif 63 63 64 + #if defined(__i386__) || defined(__x86_64__) /* arch */ 64 65 /* 65 66 * gcc cpuid.h provides __cpuid_count() since v4.4. 66 67 * Clang/LLVM cpuid.h provides __cpuid_count() since v3.4.0. ··· 76 75 : "=a" (a), "=b" (b), "=c" (c), "=d" (d) \ 77 76 : "0" (level), "2" (count)) 78 77 #endif 78 + #endif /* end arch */ 79 79 80 80 /* define kselftest exit codes */ 81 81 #define KSFT_PASS 0 ··· 373 371 374 372 static inline __noreturn void ksft_exit_fail_perror(const char *msg) 375 373 { 376 - #ifndef NOLIBC 377 374 ksft_exit_fail_msg("%s: %s (%d)\n", msg, strerror(errno), errno); 378 - #else 379 - /* 380 - * nolibc doesn't provide strerror() and it seems 381 - * inappropriate to add one, just print the errno. 382 - */ 383 - ksft_exit_fail_msg("%s: %d)\n", msg, errno); 384 - #endif 385 375 } 386 376 387 377 static inline __noreturn void ksft_exit_xfail(void)
+4 -14
tools/testing/selftests/kselftest_harness.h
··· 488 488 * Use once to append a main() to the test file. 489 489 */ 490 490 #define TEST_HARNESS_MAIN \ 491 - static void __attribute__((constructor)) \ 492 - __constructor_order_last(void) \ 493 - { \ 494 - if (!__constructor_order) \ 495 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; \ 496 - } \ 497 491 int main(int argc, char **argv) { \ 498 492 return test_harness_run(argc, argv); \ 499 493 } ··· 818 824 item->prev = item; \ 819 825 return; \ 820 826 } \ 821 - if (__constructor_order == _CONSTRUCTOR_ORDER_FORWARD) { \ 827 + if (__constructor_order_forward) { \ 822 828 item->next = NULL; \ 823 829 item->prev = head->prev; \ 824 830 item->prev->next = item; \ ··· 882 888 } 883 889 884 890 static struct __fixture_metadata *__fixture_list = &_fixture_global; 885 - static int __constructor_order; 886 - 887 - #define _CONSTRUCTOR_ORDER_FORWARD 1 888 - #define _CONSTRUCTOR_ORDER_BACKWARD -1 891 + static bool __constructor_order_forward; 889 892 890 893 static inline void __register_fixture(struct __fixture_metadata *f) 891 894 { ··· 933 942 * list so tests are run in source declaration order. 934 943 * https://gcc.gnu.org/onlinedocs/gccint/Initialization.html 935 944 * However, it seems not all toolchains do this correctly, so use 936 - * __constructor_order to detect which direction is called first 945 + * __constructor_order_foward to detect which direction is called first 937 946 * and adjust list building logic to get things running in the right 938 947 * direction. 939 948 */ ··· 1328 1337 1329 1338 static void __attribute__((constructor)) __constructor_order_first(void) 1330 1339 { 1331 - if (!__constructor_order) 1332 - __constructor_order = _CONSTRUCTOR_ORDER_FORWARD; 1340 + __constructor_order_forward = true; 1333 1341 } 1334 1342 1335 1343 #endif /* __KSELFTEST_HARNESS_H */
+1 -2
tools/testing/selftests/lib/Makefile
··· 4 4 # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" 5 5 all: 6 6 7 - TEST_PROGS := printf.sh bitmap.sh prime_numbers.sh scanf.sh strscpy.sh 8 - 7 + TEST_PROGS := printf.sh bitmap.sh prime_numbers.sh scanf.sh 9 8 include ../lib.mk
-1
tools/testing/selftests/lib/config
··· 2 2 CONFIG_TEST_SCANF=m 3 3 CONFIG_TEST_BITMAP=m 4 4 CONFIG_PRIME_NUMBERS=m 5 - CONFIG_TEST_STRSCPY=m 6 5 CONFIG_TEST_BITOPS=m
-3
tools/testing/selftests/lib/strscpy.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0+ 3 - $(dirname $0)/../kselftest/module.sh "strscpy*" test_strscpy
+5 -2
tools/testing/selftests/resctrl/cat_test.c
··· 290 290 291 291 static bool arch_supports_noncont_cat(const struct resctrl_test *test) 292 292 { 293 - unsigned int eax, ebx, ecx, edx; 294 - 295 293 /* AMD always supports non-contiguous CBM. */ 296 294 if (get_vendor() == ARCH_AMD) 297 295 return true; 298 296 297 + #if defined(__i386__) || defined(__x86_64__) /* arch */ 298 + unsigned int eax, ebx, ecx, edx; 299 299 /* Intel support for non-contiguous CBM needs to be discovered. */ 300 300 if (!strcmp(test->resource, "L3")) 301 301 __cpuid_count(0x10, 1, eax, ebx, ecx, edx); ··· 305 305 return false; 306 306 307 307 return ((ecx >> 3) & 1); 308 + #endif /* end arch */ 309 + 310 + return false; 308 311 } 309 312 310 313 static int noncont_cat_run_test(const struct resctrl_test *test,
-7
tools/testing/selftests/rtc/rtctest.c
··· 410 410 ASSERT_EQ(new, secs); 411 411 } 412 412 413 - static void __attribute__((constructor)) 414 - __constructor_order_last(void) 415 - { 416 - if (!__constructor_order) 417 - __constructor_order = _CONSTRUCTOR_ORDER_BACKWARD; 418 - } 419 - 420 413 int main(int argc, char **argv) 421 414 { 422 415 switch (argc) {
+1
tools/testing/selftests/rust/config
··· 1 + # CONFIG_GCC_PLUGINS is not set 1 2 CONFIG_RUST=y 2 3 CONFIG_SAMPLES=y 3 4 CONFIG_SAMPLES_RUST=y
-3
tools/testing/selftests/timers/change_skew.c
··· 30 30 #include <time.h> 31 31 #include "../kselftest.h" 32 32 33 - #define NSEC_PER_SEC 1000000000LL 34 - 35 - 36 33 int change_skew_test(int ppm) 37 34 { 38 35 struct timex tx;
-2
tools/testing/selftests/timers/skew_consistency.c
··· 36 36 #include <sys/wait.h> 37 37 #include "../kselftest.h" 38 38 39 - #define NSEC_PER_SEC 1000000000LL 40 - 41 39 int main(int argc, char **argv) 42 40 { 43 41 struct timex tx;
+2 -2
tools/testing/selftests/timers/threadtest.c
··· 38 38 int listcount = 0; 39 39 40 40 41 - void checklist(struct timespec *list, int size) 41 + void checklist(const struct timespec *list, int size) 42 42 { 43 43 int i, j; 44 - struct timespec *a, *b; 44 + const struct timespec *a, *b; 45 45 46 46 /* scan the list */ 47 47 for (i = 0; i < size-1; i++) {
+1 -1
tools/testing/selftests/tpm2/test_async.sh
··· 7 7 [ -e /dev/tpm0 ] || exit $ksft_skip 8 8 [ -e /dev/tpmrm0 ] || exit $ksft_skip 9 9 10 - python3 -m unittest -v tpm2_tests.AsyncTest 10 + python3 -m unittest -v tpm2_tests.AsyncTest 2>&1
+1 -1
tools/testing/selftests/tpm2/test_smoke.sh
··· 6 6 7 7 [ -e /dev/tpm0 ] || exit $ksft_skip 8 8 9 - python3 -m unittest -v tpm2_tests.SmokeTest 9 + python3 -m unittest -v tpm2_tests.SmokeTest 2>&1
+1 -1
tools/testing/selftests/tpm2/test_space.sh
··· 6 6 7 7 [ -e /dev/tpmrm0 ] || exit $ksft_skip 8 8 9 - python3 -m unittest -v tpm2_tests.SpaceTest 9 + python3 -m unittest -v tpm2_tests.SpaceTest 2>&1
-9
tools/testing/selftests/user/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - # Makefile for user memory selftests 3 - 4 - # No binaries, but make sure arg-less "make" doesn't trigger "run_tests" 5 - all: 6 - 7 - TEST_PROGS := test_user_copy.sh 8 - 9 - include ../lib.mk
-1
tools/testing/selftests/user/config
··· 1 - CONFIG_TEST_USER_COPY=m
-18
tools/testing/selftests/user/test_user_copy.sh
··· 1 - #!/bin/sh 2 - # SPDX-License-Identifier: GPL-2.0 3 - # Runs copy_to/from_user infrastructure using test_user_copy kernel module 4 - 5 - # Kselftest framework requirement - SKIP code is 4. 6 - ksft_skip=4 7 - 8 - if ! /sbin/modprobe -q -n test_user_copy; then 9 - echo "user: module test_user_copy is not found [SKIP]" 10 - exit $ksft_skip 11 - fi 12 - if /sbin/modprobe -q test_user_copy; then 13 - /sbin/modprobe -q -r test_user_copy 14 - echo "user_copy: ok" 15 - else 16 - echo "user_copy: [FAIL]" 17 - exit 1 18 - fi