selftests/bpf: Add few corner cases to test padding handling of btf_dump
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 12 Dec 2022 21:15:05 +0000 (13:15 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:57 +0000 (12:10 +0200)
commit6c8afd54f8e99508148099e17cfec21b9fbadb6a
tree05f3a40679d1fe690c099528c4b1c22ac884b2c9
parent524617e553bc33f881ec3d4d5233fa1bb1e119de
selftests/bpf: Add few corner cases to test padding handling of btf_dump

[ Upstream commit b148c8b9b926e257a59c8eb2cd6fa3adfd443254 ]

Add few hand-crafted cases and few randomized cases found using script
from [0] that tests btf_dump's padding logic.

  [0] https://lore.kernel.org/bpf/85f83c333f5355c8ac026f835b18d15060725fcb.camel@ericsson.com/

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20221212211505.558851-7-andrii@kernel.org
Stable-dep-of: 4fb877aaa179 ("libbpf: Fix btf_dump's packed struct determination")
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/selftests/bpf/progs/btf_dump_test_case_packing.c
tools/testing/selftests/bpf/progs/btf_dump_test_case_padding.c