diff options
| author | Andrey Ignatov <rdna@fb.com> | 2019-12-18 23:44:38 -0800 | 
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2019-12-19 21:22:26 -0800 | 
| commit | 06ac0186bd242d44f5703ce64ee0077b317c86bb (patch) | |
| tree | 18a302018c3a5b382a58f6c534d9b6ed651bf696 /tools/testing/selftests/bpf/test_cpp.cpp | |
| parent | 257c88559f360ef40d251942f1f9f0c55f5f91ca (diff) | |
selftests/bpf: Test BPF_F_REPLACE in cgroup_attach_multi
Test replacing a cgroup-bpf program attached with BPF_F_ALLOW_MULTI and
possible failure modes: invalid combination of flags, invalid
replace_bpf_fd, replacing a non-attachd to specified cgroup program.
Example of program replacing:
  # gdb -q --args ./test_progs --name=cgroup_attach_multi
  ...
  Breakpoint 1, test_cgroup_attach_multi () at cgroup_attach_multi.c:227
  (gdb)
  [1]+  Stopped                 gdb -q --args ./test_progs --name=cgroup_attach_multi
  # bpftool c s /mnt/cgroup2/cgroup-test-work-dir/cg1
  ID       AttachType      AttachFlags     Name
  2133     egress          multi
  2134     egress          multi
  # fg
  gdb -q --args ./test_progs --name=cgroup_attach_multi
  (gdb) c
  Continuing.
  Breakpoint 2, test_cgroup_attach_multi () at cgroup_attach_multi.c:233
  (gdb)
  [1]+  Stopped                 gdb -q --args ./test_progs --name=cgroup_attach_multi
  # bpftool c s /mnt/cgroup2/cgroup-test-work-dir/cg1
  ID       AttachType      AttachFlags     Name
  2139     egress          multi
  2134     egress          multi
Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/7b9b83e8d5fb82e15b034341bd40b6fb2431eeba.1576741281.git.rdna@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_cpp.cpp')
0 files changed, 0 insertions, 0 deletions
