]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: add auto-detach test
authorRoman Gushchin <guro@fb.com>
Sat, 25 May 2019 16:37:42 +0000 (09:37 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 28 May 2019 16:30:02 +0000 (09:30 -0700)
commitacd5f5662bb90428db086ab38c6b30df6067ef07
tree04a5e404b72a3da736c7bd3bc0cfa40ee6658daf
parentd0e6dbe5c1a44b418ca87f939066a95d2aee3fd9
selftests/bpf: add auto-detach test

Add a kselftest to cover bpf auto-detachment functionality.
The test creates a cgroup, associates some resources with it,
attaches a couple of bpf programs and deletes the cgroup.

Then it checks that bpf programs are going away in 5 seconds.

Expected output:
  $ ./test_cgroup_attach
  #override:PASS
  #multi:PASS
  #autodetach:PASS
  test_cgroup_attach:PASS

On a kernel without auto-detaching:
  $ ./test_cgroup_attach
  #override:PASS
  #multi:PASS
  #autodetach:FAIL
  test_cgroup_attach:FAIL

Signed-off-by: Roman Gushchin <guro@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/test_cgroup_attach.c