selftests/bpf: Test bpf_sk_storage_get in tcp iterators
authorFlorent Revest <revest@chromium.org>
Fri, 4 Dec 2020 11:36:09 +0000 (12:36 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 4 Dec 2020 21:32:40 +0000 (22:32 +0100)
commit34da87213d3ddd26643aa83deff7ffc6463da0fc
tree8dca2f1c1cfefc0fe847186de2ad1feaf1e420e1
parentbd9b327e58f98aa7126291bf12b50720c660e787
selftests/bpf: Test bpf_sk_storage_get in tcp iterators

This extends the existing bpf_sk_storage_get test where a socket is
created and tagged with its creator's pid by a task_file iterator.

A TCP iterator is now also used at the end of the test to negate the
values already stored in the local storage. The test therefore expects
-getpid() to be stored in the local storage.

Signed-off-by: Florent Revest <revest@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20201204113609.1850150-6-revest@google.com
tools/testing/selftests/bpf/prog_tests/bpf_iter.c
tools/testing/selftests/bpf/progs/bpf_iter_bpf_sk_storage_helpers.c