pidfd: add polling selftests
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Tue, 30 Apr 2019 16:21:54 +0000 (12:21 -0400)
committerChristian Brauner <christian@brauner.io>
Fri, 28 Jun 2019 10:17:55 +0000 (12:17 +0200)
commit740378dc7834bc511ac1ecb2157696681d2a1d32
tree9f1a2838263e8bfbe21efd563d3536a55101ce50
parentb53b0b9d9a613c418057f6cb921c2f40a6f78c24
pidfd: add polling selftests

Other than verifying pidfd based polling, the tests make sure that
wait semantics are preserved with the pidfd poll. Notably the 2 cases:
1. If a thread group leader exits while threads still there, then no
   pidfd poll notifcation should happen.
2. If a non-thread group leader does an execve, then the thread group
   leader is signaled to exit and is replaced with the execing thread
   as the new leader, however the parent is not notified in this case.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Christian Brauner <christian@brauner.io>
tools/testing/selftests/pidfd/Makefile
tools/testing/selftests/pidfd/pidfd_test.c