summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>2018-05-31 13:42:37 +0900
committerDaniel Borkmann <daniel@iogearbox.net>2018-06-02 06:13:56 +0200
commit035b37ff2c6e3577b8ad7d5c3cc4619ab74559bb (patch)
tree847d1c71b5da4525806e50f5dfff2b3c8425b390 /tools
parent16edddfe3c5d192f097c27ff60cae05daa29f782 (diff)
downloadlinux-0-day-035b37ff2c6e3577b8ad7d5c3cc4619ab74559bb.tar.gz
linux-0-day-035b37ff2c6e3577b8ad7d5c3cc4619ab74559bb.tar.xz
selftests/bpf: test_sockmap, join cgroup in selftest mode
In case of selftest mode, temporary cgroup environment is created but cgroup is not joined. It causes test failures. Fixed by joining the cgroup Fixes: 16962b2404ac ("bpf: sockmap, add selftests") Acked-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/test_sockmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 7b2008a144cb3..7f9ca79aadbcc 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -1344,6 +1344,11 @@ static int __test_suite(char *bpf_file)
return cg_fd;
}
+ if (join_cgroup(CG_PATH)) {
+ fprintf(stderr, "ERROR: failed to join cgroup\n");
+ return -EINVAL;
+ }
+
/* Tests basic commands and APIs with range of iov values */
txmsg_start = txmsg_end = 0;
err = test_txmsg(cg_fd);