Thread (23 messages) 23 messages, 5 authors, 2022-08-16

Re: [PATCH bpf-next v7 5/8] selftests/bpf: Test cgroup_iter.

From: Andrii Nakryiko <hidden>
Date: 2022-08-09 00:20:52
Also in: bpf, cgroups, lkml

On Fri, Aug 5, 2022 at 2:49 PM Hao Luo [off-list ref] wrote:
Add a selftest for cgroup_iter. The selftest creates a mini cgroup tree
of the following structure:

    ROOT (working cgroup)
     |
   PARENT
  /      \
CHILD1  CHILD2

and tests the following scenarios:

 - invalid cgroup fd.
 - pre-order walk over descendants from PARENT.
 - post-order walk over descendants from PARENT.
 - walk of ancestors from PARENT.
 - walk from PARENT in the default order, which is pre-order.
 - process only a single object (i.e. PARENT).
 - early termination.

Acked-by: Yonghong Song <redacted>
Signed-off-by: Hao Luo <redacted>
---
LGTM.

Acked-by: Andrii Nakryiko <andrii@kernel.org>
 .../selftests/bpf/prog_tests/cgroup_iter.c    | 237 ++++++++++++++++++
 tools/testing/selftests/bpf/progs/bpf_iter.h  |   7 +
 .../testing/selftests/bpf/progs/cgroup_iter.c |  39 +++
 3 files changed, 283 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
 create mode 100644 tools/testing/selftests/bpf/progs/cgroup_iter.c
[...]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help