aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/pidfd/pidfd_getfd_test.c
AgeCommit message (Collapse)AuthorFilesLines
2024-02-07selftests: add ESRCH tests for pidfd_getfd()Tycho Andersen1-1/+30
Ensure that pidfd_getfd() reports -ESRCH if the task is already exiting. Signed-off-by: Tycho Andersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
2020-10-27selftests: pidfd: skip test on kcmp() ENOSYSTommi Rantala1-1/+4
Skip test if kcmp() is not available, for example if kernel is compiled without CONFIG_CHECKPOINT_RESTORE=y. Signed-off-by: Tommi Rantala <[email protected]> Acked-by: Christian Brauner <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-07-06selftests: Remove unneeded selftest API headersKees Cook1-1/+0
Remove unused includes of the kselftest.h header. Acked-by: Christian Brauner <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2020-06-17tests: test for setns() EINVAL regressionChristian Brauner1-5/+0
Verify that setns() reports EINVAL when an fd is passed that refers to an open file but the file is not a file descriptor useable to interact with namespaces. Cc: Jan Stancek <[email protected]> Cc: Cyril Hrubis <[email protected]> Link: https://lore.kernel.org/lkml/20200615085836.GR12456@shao2-debian Signed-off-by: Christian Brauner <[email protected]>
2020-01-13test: Add test for pidfd getfdSargun Dhillon1-0/+249
The following tests: * Fetch FD, and then compare via kcmp * Make sure getfd can be blocked by blocking ptrace_may_access * Making sure fetching bad FDs fails * Make sure trying to set flags to non-zero results in an EINVAL Signed-off-by: Sargun Dhillon <[email protected]> Acked-by: Christian Brauner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>