]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf/test_offload.py: Filter bpftool internal map when counting maps
authorToke Høiland-Jørgensen <toke@redhat.com>
Wed, 9 Dec 2020 13:57:43 +0000 (14:57 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 9 Dec 2020 15:27:42 +0000 (16:27 +0100)
commita5ef05f43db10e8e7085a6bfe64ec257b4fb6f49
tree30c4259edb62f3577d392420d48c1ffa68de0758
parentd3ea5352da3610a40c8c08fc2b37de7f7d4858f4
selftests/bpf/test_offload.py: Filter bpftool internal map when counting maps

A few of the tests in test_offload.py expects to see a certain number of
maps created, and checks this by counting the number of maps returned by
bpftool. There is already a filter that will remove any maps already there
at the beginning of the test, but bpftool now creates a map for the PID
iterator rodata on each invocation, which makes the map count wrong. Fix
this by also filtering the pid_iter.rodata map by name when counting.

Fixes: 060a25bb4bbc ("tools/bpftool: Show info for processes holding BPF map/prog/link/btf FDs")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/bpf/160752226387.110217.9887866138149423444.stgit@toke.dk
tools/testing/selftests/bpf/test_offload.py