]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: test_progs: add test__join_cgroup helper
authorStanislav Fomichev <sdf@google.com>
Wed, 4 Sep 2019 16:25:04 +0000 (09:25 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 6 Sep 2019 16:59:05 +0000 (09:59 -0700)
commit5d9ba31b0f566fb4197d6e5306d4245f4dfa2237
tree70641d1344b6ba00d70a9012812daaee43329eb5
parent9241aec5692f68bc644cc6d396e337f27f833530
selftests/bpf: test_progs: add test__join_cgroup helper

test__join_cgroup() combines the following operations that usually
go hand in hand and returns cgroup fd:

  * setup cgroup environment (make sure cgroupfs is mounted)
  * mkdir cgroup
  * join cgroup

It also marks a test as a "cgroup cleanup needed" and removes cgroup
state after the test is done.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/test_progs.c
tools/testing/selftests/bpf/test_progs.h