]> git.baikalelectronics.ru Git - kernel.git/commit
test: Add test for pidfd getfd
authorSargun Dhillon <sargun@sargun.me>
Tue, 7 Jan 2020 17:59:27 +0000 (09:59 -0800)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 13 Jan 2020 20:49:54 +0000 (21:49 +0100)
commitc08dcdabd321e5b769316e7a83c7d98a752720f4
tree681e1f79da80c11111ec39e28d87d8362c276e15
parentf78ca0c811eb557f9145ff45f78fe4379b95f4df
test: Add test for pidfd getfd

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 <sargun@sargun.me>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Link: https://lore.kernel.org/r/20200107175927.4558-5-sargun@sargun.me
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
tools/testing/selftests/pidfd/.gitignore
tools/testing/selftests/pidfd/Makefile
tools/testing/selftests/pidfd/pidfd.h
tools/testing/selftests/pidfd/pidfd_getfd_test.c [new file with mode: 0644]