selftests/bpf: Test load and dump metadata with btftool and skel
authorYiFei Zhu <zhuyifei@google.com>
Tue, 15 Sep 2020 23:45:43 +0000 (16:45 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 16 Sep 2020 01:28:27 +0000 (18:28 -0700)
commitd42d1cc44d702123d6ff12ce54a0e854036d29cb
treed4cb7f11dd9c6d75bd829770ffdf9dcc68203f67
parentaff52e685eb39984f3a613e8a5c570d97e5d2414
selftests/bpf: Test load and dump metadata with btftool and skel

This is a simple test to check that loading and dumping metadata
in btftool works, whether or not metadata contents are used by the
program.

A C test is also added to make sure the skeleton code can read the
metadata values.

Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Link: https://lore.kernel.org/bpf/20200915234543.3220146-6-sdf@google.com
tools/testing/selftests/bpf/Makefile
tools/testing/selftests/bpf/prog_tests/metadata.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/metadata_unused.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/metadata_used.c [new file with mode: 0644]
tools/testing/selftests/bpf/test_bpftool_metadata.sh [new file with mode: 0755]