pidfd: add pidfd_wait tests

Add tests for pidfd_wait() and CLONE_WAIT_PID:
- test that pidfd_wait() syscall is supported
- test that pidfd_wait() does not accept unknown flags
- test that pidfd_wait() can wait on a pidfd
- test that pidfd_wait() can wait on a pidfd and return struct rusage
- test that pidfd_wait() can wait on a pidfd and return siginfo_t
- test that pidfd_wait() works with WEXITED
- test that pidfd_wait() works with WSTOPPED
- test that pidfd_wait() works with WUNTRACED
- test that pidfd_wait() works with WCONTINUED
- test that pidfd_wait() works with WNOWAIT
- test that pidfd_wait() works with WNOHANG
- test that CLONE_WAIT_PID does not appear in waitid(P_ALL) requests
- test that CLONE_WAIT_PID does not appear in waitid(P_PGID) requests
- test that CLONE_WAIT_PID does not appear in wait4(-1) requests
- test that CLONE_WAIT_PID does not appear in wait4(0) requests
- test that CLONE_WAIT_PID does appear in waitid(P_PID) requests
- test that CLONE_WAIT_PID does appear in wait4(pid) requests

Signed-off-by: Christian Brauner <christian@brauner.io>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Howells <dhowells@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirsky <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
3 files changed