tests: add close_range() tests
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 20 May 2019 14:13:28 +0000 (16:13 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 16 Jun 2020 22:07:38 +0000 (00:07 +0200)
commit2c5db60e46ad7f03789fe7e2beedb15496930468
tree4a4beed4d50fa635c5756d6a13e33a31d927f38f
parent9b4feb630e8e9801603f3cab3a36369e3c1cf88d
tests: add close_range() tests

This adds basic tests for the new close_range() syscall.
- test that no invalid flags can be passed
- test that a range of file descriptors is correctly closed
- test that a range of file descriptors is correctly closed if there there
  are already closed file descriptors in the range
- test that max_fd is correctly capped to the current fdtable maximum

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jann Horn <jannh@google.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Dmitry V. Levin <ldv@altlinux.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: linux-api@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
tools/testing/selftests/Makefile
tools/testing/selftests/core/.gitignore [new file with mode: 0644]
tools/testing/selftests/core/Makefile [new file with mode: 0644]
tools/testing/selftests/core/close_range_test.c [new file with mode: 0644]