tests: test for setns() EINVAL regression
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 16 Jun 2020 22:48:54 +0000 (00:48 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 16 Jun 2020 22:48:54 +0000 (00:48 +0200)
commit86f56395feb2b106b125c47e72192e37da5dd088
treea63cde19caa1c5ebe0d436d836bc464f4c25b238
parente571d4ee334719727f22cce30c4c74471d4ef68a
tests: test for setns() EINVAL regression

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 <jstancek@redhat.com>
Cc: Cyril Hrubis <chrubis@suse.cz>
Link: https://lore.kernel.org/lkml/20200615085836.GR12456@shao2-debian
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
tools/testing/selftests/pidfd/pidfd.h
tools/testing/selftests/pidfd/pidfd_getfd_test.c
tools/testing/selftests/pidfd/pidfd_setns_test.c