selftests/cgroup: add tests for cloning into cgroups
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 5 Feb 2020 13:26:23 +0000 (14:26 +0100)
committerTejun Heo <tj@kernel.org>
Wed, 12 Feb 2020 22:57:51 +0000 (17:57 -0500)
commit9bd5910d7f3db2f65be139d2679dd9daa4a3419a
tree66c5d5196bfd2d362f398f2cf7eb8e08e988ae4a
parentef2c41cf38a7559bbf91af42d5b6a4429db8fc68
selftests/cgroup: add tests for cloning into cgroups

Expand the cgroup test-suite to include tests for CLONE_INTO_CGROUP.
This adds the following tests:
- CLONE_INTO_CGROUP manages to clone a process directly into a correctly
  delegated cgroup
- CLONE_INTO_CGROUP fails to clone a process into a cgroup that has been
  removed after we've opened an fd to it
- CLONE_INTO_CGROUP fails to clone a process into an invalid domain
  cgroup
- CLONE_INTO_CGROUP adheres to the no internal process constraint
- CLONE_INTO_CGROUP works with the freezer feature

Cc: Tejun Heo <tj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: cgroups@vger.kernel.org
Cc: linux-kselftest@vger.kernel.org
Acked-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/testing/selftests/cgroup/Makefile
tools/testing/selftests/cgroup/cgroup_util.c
tools/testing/selftests/cgroup/cgroup_util.h
tools/testing/selftests/cgroup/test_core.c
tools/testing/selftests/clone3/clone3_selftests.h