diff options
author | Stanislav Fomichev <sdf@google.com> | 2019-09-04 19:25:04 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-09-06 19:59:05 +0300 |
commit | 88dadc632763bdccddf99d8454aa3a7932605f00 (patch) | |
tree | 70641d1344b6ba00d70a9012812daaee43329eb5 /tools/testing/selftests/bpf/test_progs.h | |
parent | 618916a4bf169450e4680173a4b105a1816a7d6d (diff) | |
download | linux-88dadc632763bdccddf99d8454aa3a7932605f00.tar.xz |
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>
Diffstat (limited to 'tools/testing/selftests/bpf/test_progs.h')
-rw-r--r-- | tools/testing/selftests/bpf/test_progs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h index c8edb9464ba6..e518bd5da3e2 100644 --- a/tools/testing/selftests/bpf/test_progs.h +++ b/tools/testing/selftests/bpf/test_progs.h @@ -71,6 +71,7 @@ extern void test__force_log(); extern bool test__start_subtest(const char *name); extern void test__skip(void); extern void test__fail(void); +extern int test__join_cgroup(const char *path); #define MAGIC_BYTES 123 |