selftests/bpf: Merge most of test_btf into test_progs
authorAndrii Nakryiko <andriin@fb.com>
Wed, 16 Sep 2020 00:48:19 +0000 (17:48 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 16 Sep 2020 01:37:33 +0000 (18:37 -0700)
commitc64779e24e88a9915b2f35fbb9851ef2c5462cc2
tree1c61e5b88a979036680fbf3d369bddfcc631a76b
parentffa915f46193b6be780483c8d31cc53f093f6d9a
selftests/bpf: Merge most of test_btf into test_progs

Merge 183 tests from test_btf into test_progs framework to be exercised
regularly. All the test_btf tests that were moved are modeled as proper
sub-tests in test_progs framework for ease of debugging and reporting.

No functional or behavioral changes were intended, I tried to preserve
original behavior as much as possible. E.g., `test_progs -v` will activate
"always_log" flag to emit BTF validation log.

The only difference is in reducing the max_entries limit for pretty-printing
tests from (128 * 1024) to just 128 to reduce tests running time without
reducing the coverage.

Example test run:

  $ sudo ./test_progs -n 8
  ...
  #8 btf:OK
  Summary: 1/183 PASSED, 0 SKIPPED, 0 FAILED

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200916004819.3767489-1-andriin@fb.com
tools/testing/selftests/bpf/.gitignore
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/btf.c [moved from tools/testing/selftests/bpf/test_btf.c with 96% similarity]