aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/test_progs.h
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2019-09-04 09:25:04 -0700
committerAlexei Starovoitov <ast@kernel.org>2019-09-06 09:59:05 -0700
commit88dadc632763bdccddf99d8454aa3a7932605f00 (patch)
tree70641d1344b6ba00d70a9012812daaee43329eb5 /tools/testing/selftests/bpf/test_progs.h
parentkbuild: replace BASH-specific ${@:2} with shift and ${@} (diff)
downloadlinux-dev-88dadc632763bdccddf99d8454aa3a7932605f00.tar.xz
linux-dev-88dadc632763bdccddf99d8454aa3a7932605f00.zip
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.h1
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