linux-stable/tools/testing/selftests
Tiezhu Yang 4c004ed952 selftests/clone3: Fix broken test under !CONFIG_TIME_NS
commit fc7f04dc23 upstream.

When execute the following command to test clone3 under !CONFIG_TIME_NS:

  # make headers && cd tools/testing/selftests/clone3 && make && ./clone3

we can see the following error info:

  # [7538] Trying clone3() with flags 0x80 (size 0)
  # Invalid argument - Failed to create new process
  # [7538] clone3() with flags says: -22 expected 0
  not ok 18 [7538] Result (-22) is different than expected (0)
  ...
  # Totals: pass:18 fail:1 xfail:0 xpass:0 skip:0 error:0

This is because if CONFIG_TIME_NS is not set, but the flag
CLONE_NEWTIME (0x80) is used to clone a time namespace, it
will return -EINVAL in copy_time_ns().

If kernel does not support CONFIG_TIME_NS, /proc/self/ns/time
will be not exist, and then we should skip clone3() test with
CLONE_NEWTIME.

With this patch under !CONFIG_TIME_NS:

  # make headers && cd tools/testing/selftests/clone3 && make && ./clone3
  ...
  # Time namespaces are not supported
  ok 18 # SKIP Skipping clone3() with CLONE_NEWTIME
  ...
  # Totals: pass:18 fail:0 xfail:0 xpass:0 skip:1 error:0

Link: https://lkml.kernel.org/r/1689066814-13295-1-git-send-email-yangtiezhu@loongson.cn
Fixes: 515bddf0ec ("selftests/clone3: test clone3 with CLONE_NEWTIME")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:20:05 +00:00
..
alsa selftests: ALSA: remove unused variables 2023-09-11 08:20:52 +02:00
amd-pstate linux-kselftest-next-6.4-rc1 2023-04-24 12:28:34 -07:00
arm64 Merge branch 'for-next/selftests' into for-next/core 2023-08-25 12:36:57 +01:00
bpf bpf: fix control-flow graph checking in privileged mode 2023-11-28 17:19:50 +00:00
breakpoints
cachestat linux-kselftest-next-6.6-rc1 2023-08-28 18:46:47 -07:00
capabilities
cgroup cgroup: Changes for v6.6 2023-09-01 15:58:21 -07:00
clone3 selftests/clone3: Fix broken test under !CONFIG_TIME_NS 2023-11-28 17:20:05 +00:00
connector selftests: connector: Fix input argument error paths to skip 2023-07-31 20:11:42 -07:00
core
cpu-hotplug
cpufreq selftests/cpufreq: Don't enable generic lock debugging options 2023-06-12 16:39:11 -06:00
damon selftests/damon/sysfs: test damon_target filter 2023-08-21 13:37:37 -07:00
dma
dmabuf-heaps
drivers selftests: bonding: create directly devices in the target namespaces 2023-08-28 10:24:08 +01:00
efivarfs selftests/efivarfs: create-read: fix a resource leak 2023-11-28 17:19:42 +00:00
exec
fchmodat2 selftests: link libasan statically for tests with -fsanitize=address 2023-09-19 13:21:32 -07:00
filelock selftests: add OFD lock tests 2023-08-24 10:41:47 -04:00
filesystems selftests/filesystems: Add six consecutive 'x' characters to mktemp 2023-08-16 10:10:39 -06:00
firmware
fpu
ftrace selftests/ftrace: Add new test case which checks non unique symbol 2023-10-20 22:11:49 +09:00
futex selftests/futex: Order calls to futex_lock_pi 2023-08-16 10:48:10 -06:00
gpio gpio updates for v6.5 2023-06-29 10:11:10 -07:00
hid for-netdev 2023-07-13 19:13:24 -07:00
ia64
intel_pstate
iommu iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl 2023-08-18 12:52:15 -03:00
ipc
ir
kcmp
kexec
kmod
kselftest linux-kselftest-next-6.6-rc2 2023-09-12 09:10:36 -07:00
kvm KVM selftests fixes for 6.6: 2023-10-15 08:25:18 -04:00
landlock selftests/landlock: Fix a resource leak 2023-08-30 18:53:08 +02:00
lib
livepatch
lkdtm selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config 2023-11-28 17:19:36 +00:00
locking
media_tests selftests: media_tests: Add new subtest to video_device_test 2023-06-12 16:39:10 -06:00
membarrier
memfd selftests: improve vm.memfd_noexec sysctl tests 2023-08-21 13:38:00 -07:00
memory-hotplug
mincore selftests/mincore: fix skip condition for check_huge_pages test 2023-07-13 12:51:13 -06:00
mm kselftest: vm: fix mdwe's mmap_FIXED test case 2023-11-20 11:59:20 +01:00
mount
mount_setattr selftests mount: Fix mount_setattr_test builds failed 2023-03-31 09:18:45 -06:00
move_mount_set_group
mqueue
nci
net selftests: mptcp: fix wait_rm_addr/sf parameters 2023-11-20 11:59:38 +01:00
netfilter net: skb_find_text: Ignore patterns extending past 'to' 2023-11-20 11:59:01 +01:00
nolibc linux-kselftest-nolibc-6.6-rc1 2023-08-28 19:03:24 -07:00
nsfs
ntb
openat2 selftests: link libasan statically for tests with -fsanitize=address 2023-09-19 13:21:32 -07:00
perf_events
pid_namespace
pidfd selftests/pidfd: Fix ksft print formats 2023-11-20 11:59:17 +01:00
powerpc selftests/powerpc: Fix emit_tests to work with run_kselftest.sh 2023-09-22 20:29:48 +10:00
prctl selftests:prctl: add set-process-name to .gitignore 2023-07-25 10:33:25 -06:00
proc selftests/proc: fixup proc-empty-vm test after KSM changes 2023-09-19 13:21:33 -07:00
pstore
ptp selftests/ptp: Add -X option for testing PTP_SYS_OFFSET_PRECISE 2023-07-28 10:59:40 +01:00
ptrace Update for entry and ptrace: 2023-04-25 11:05:04 -07:00
rcutorture smp_call_function torture-test updates for v6.6 2023-08-28 13:42:29 -07:00
resctrl selftests/resctrl: Reduce failures due to outliers in MBA/MBM tests 2023-11-28 17:20:04 +00:00
riscv riscv: kselftests: Fix mm build by removing testcases subdirectory 2023-09-20 02:29:26 -07:00
rlimits
rseq linux-kselftest-next-6.6-rc1 2023-08-28 18:46:47 -07:00
rtc
safesetid
sched
seccomp selftests/seccomp: Handle arm32 corner cases better 2023-08-10 13:26:19 -07:00
sgx selftests/sgx: Add "test_encl.elf" to TEST_FILES 2023-05-08 11:01:03 -06:00
sigaltstack
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl test_sysclt: Test for registering a mount point 2023-06-18 02:32:54 -07:00
tc-testing selftests/tc-testing: verify that a qdisc can be grafted onto a taprio class 2023-08-09 15:59:21 -07:00
tdx
timens
timers tools: timers: fix freq average calculation 2023-07-13 13:32:36 -06:00
tmpfs
tpm2
tty selftests: tty: add selftest for tty timestamp updates 2023-06-15 13:45:42 +02:00
uevent
user
user_events selftests/user_events: Fix abi_test for BE archs 2023-10-17 15:07:19 -06:00
vDSO kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined 2023-06-12 16:39:10 -06:00
watchdog
wireguard treewide: drop CONFIG_EMBEDDED 2023-08-21 13:46:25 -07:00
x86 selftests/x86/lam: Zero out buffer for readlink() 2023-11-20 11:58:54 +01:00
zram
.gitignore
gen_kselftest_tar.sh
kselftest.h selftests: line buffer test program's stdout 2023-08-18 10:12:42 -07:00
kselftest_deps.sh selftests: fix dependency checker script 2023-09-08 10:06:49 -06:00
kselftest_harness.h selftests/harness: Actually report SKIP for signal tests 2023-08-10 23:10:09 -07:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: Keep symlinks, when possible 2023-09-08 10:06:56 -06:00
Makefile selftests: Fix wrong TARGET in kselftest top level Makefile 2023-09-26 18:47:37 -06:00
run_kselftest.sh kselftests: Sort the collections list to avoid duplicate tests 2023-06-12 16:39:11 -06:00