[PATCH bpf-next v3 09/10] selftests/bpf: Fix btf_dump test for bpf_iter_link_info

Kumar Kartikeya Dwivedi
2021-12-01T04:24:59Z

Since we changed the definition while adding io_uring and epoll iterator
support, adjust the selftest to check against the updated definition.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
---
tools/testing/selftests/bpf/prog_tests/btf_dump.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/prog_tests/btf_dump.c b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
index 9e26903f9170..1678b2c49f78 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_dump.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_dump.c
@@ -736,7 +736,9 @@ static void test_btf_dump_struct_data(struct btf *btf, struct btf_dump *d,

/* union with nested struct */
TEST_BTF_DUMP_DATA(btf, d, "union", str, union bpf_iter_link_info, BTF_F_COMPACT,
- "(union bpf_iter_link_info){.map = (struct){.map_fd = (__u32)1,},}",
+ "(union bpf_iter_link_info){.map = (struct){.map_fd = (__u32)1,},"
+ ".io_uring = (struct){.io_uring_fd = (__u32)1,},"
+ ".epoll = (struct){.epoll_fd = (__u32)1,},}",
{ .map = { .map_fd = 1 }});

/* struct skb with nested structs/unions; because type output is so
--
2.34.1