bpf: add initial suite for selftests
authorDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Oct 2016 12:28:36 +0000 (14:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Oct 2016 15:35:55 +0000 (11:35 -0400)
commit5aa5bd14c5f8660c64ceedf14a549781be47e53d
tree218c2af2722d776a1b48604f42c49cd4459c0b5f
parent1a776b9ce82d2df9c7ba140588a49721ffb0dc8f
bpf: add initial suite for selftests

Add a start of a test suite for kernel selftests. This moves test_verifier
and test_maps over to tools/testing/selftests/bpf/ along with various
code improvements and also adds a script for invoking test_bpf module.
The test suite can simply be run via selftest framework, f.e.:

  # cd tools/testing/selftests/bpf/
  # make
  # make run_tests

Both test_verifier and test_maps were kind of misplaced in samples/bpf/
directory and we were looking into adding them to selftests for a while
now, so it can be picked up by kbuild bot et al and hopefully also get
more exposure and thus new test case additions.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
13 files changed:
MAINTAINERS
samples/bpf/Makefile
samples/bpf/test_maps.c [deleted file]
samples/bpf/test_verifier.c [deleted file]
tools/include/linux/filter.h
tools/testing/selftests/Makefile
tools/testing/selftests/bpf/.gitignore [new file with mode: 0644]
tools/testing/selftests/bpf/Makefile [new file with mode: 0644]
tools/testing/selftests/bpf/bpf_sys.h [new file with mode: 0644]
tools/testing/selftests/bpf/config [new file with mode: 0644]
tools/testing/selftests/bpf/test_kmod.sh [new file with mode: 0755]
tools/testing/selftests/bpf/test_maps.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_verifier.c [new file with mode: 0644]