diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2018-05-31 00:42:37 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-06-02 00:13:56 -0400 |
commit | 035b37ff2c6e3577b8ad7d5c3cc4619ab74559bb (patch) | |
tree | 847d1c71b5da4525806e50f5dfff2b3c8425b390 /tools | |
parent | 16edddfe3c5d192f097c27ff60cae05daa29f782 (diff) |
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.c | 5 |
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 7b2008a144cb..7f9ca79aadbc 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) | |||
1344 | return cg_fd; | 1344 | return cg_fd; |
1345 | } | 1345 | } |
1346 | 1346 | ||
1347 | if (join_cgroup(CG_PATH)) { | ||
1348 | fprintf(stderr, "ERROR: failed to join cgroup\n"); | ||
1349 | return -EINVAL; | ||
1350 | } | ||
1351 | |||
1347 | /* Tests basic commands and APIs with range of iov values */ | 1352 | /* Tests basic commands and APIs with range of iov values */ |
1348 | txmsg_start = txmsg_end = 0; | 1353 | txmsg_start = txmsg_end = 0; |
1349 | err = test_txmsg(cg_fd); | 1354 | err = test_txmsg(cg_fd); |