]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: skip sockmap in test_maps if kernel doesn't have support
authorStanislav Fomichev <sdf@google.com>
Mon, 28 Jan 2019 17:21:15 +0000 (09:21 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 31 Jan 2019 09:13:21 +0000 (10:13 +0100)
commitcb547b6a8d48ff1b71b7cec8228b569afb3531e0
treeb34fb0ede966bfac46fa1c5b7864fe53655f531c
parent3220eca2f2b9b49ab099bb8e644edb819dbd55aa
selftests/bpf: skip sockmap in test_maps if kernel doesn't have support

Use recently introduced bpf_probe_map_type() to skip test_sockmap()
if map creation fails. The skipped test is indicated in the output.

Example:

test_sockmap SKIP (unsupported map type BPF_MAP_TYPE_SOCKMAP)
Fork 1024 tasks to 'test_update_delete'
...
test_sockmap SKIP (unsupported map type BPF_MAP_TYPE_SOCKMAP)
Fork 1024 tasks to 'test_update_delete'
...
test_maps: OK, 2 SKIPPED

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/testing/selftests/bpf/test_maps.c