linux-imx/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
arm64
bpf bpf: fix control-flow graph checking in privileged mode 2023-11-28 17:19:50 +00:00
breakpoints
cachestat
capabilities
cgroup
clone3 selftests/clone3: Fix broken test under !CONFIG_TIME_NS 2023-11-28 17:20:05 +00:00
connector
core
cpu-hotplug
cpufreq
damon
dma
dmabuf-heaps
drivers
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
filesystems
firmware
fpu
ftrace selftests/ftrace: Add new test case which checks non unique symbol 2023-10-20 22:11:49 +09:00
futex
gpio
hid
ia64
intel_pstate
iommu
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
lib
livepatch
lkdtm selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config 2023-11-28 17:19:36 +00:00
locking
media_tests
membarrier
memfd
memory-hotplug
mincore
mm kselftest: vm: fix mdwe's mmap_FIXED test case 2023-11-20 11:59:20 +01:00
mount
mount_setattr
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
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
proc selftests/proc: fixup proc-empty-vm test after KSM changes 2023-09-19 13:21:33 -07:00
pstore
ptp
ptrace
rcutorture
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
rtc
safesetid
sched
seccomp
sgx
sigaltstack
size
sparc64
splice
static_keys
sync
syscall_user_dispatch
sysctl
tc-testing
tdx
timens
timers
tmpfs
tpm2
tty
uevent
user
user_events selftests/user_events: Fix abi_test for BE archs 2023-10-17 15:07:19 -06:00
vDSO
watchdog
wireguard
x86 selftests/x86/lam: Zero out buffer for readlink() 2023-11-20 11:58:54 +01:00
zram
.gitignore
gen_kselftest_tar.sh
kselftest_deps.sh selftests: fix dependency checker script 2023-09-08 10:06:49 -06:00
kselftest_harness.h
kselftest_install.sh
kselftest_module.h
kselftest.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