OSDN Git Service

selftest/bpf: Test batching and bpf_(get|set)sockopt in bpf unix iter.
authorKuniyuki Iwashima <kuniyu@amazon.co.jp>
Thu, 13 Jan 2022 00:28:48 +0000 (09:28 +0900)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 18 Jan 2022 23:45:06 +0000 (15:45 -0800)
commit7ff8985cc1aa462532f4afa2cc880dfd6892dd68
tree526de3f83a63e588c9a32746b0122b4c5b93dab7
parenteb7d8f1d9ebc7379f09a51bf4faa35e0bfa7437d
selftest/bpf: Test batching and bpf_(get|set)sockopt in bpf unix iter.

This patch adds a test for the batching and bpf_(get|set)sockopt in bpf
unix iter.

It does the following.

  1. Creates an abstract UNIX domain socket
  2. Call bpf_setsockopt()
  3. Call bpf_getsockopt() and save the value
  4. Call setsockopt()
  5. Call getsockopt() and save the value
  6. Compare the saved values

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Link: https://lore.kernel.org/r/20220113002849.4384-5-kuniyu@amazon.co.jp
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter_setsockopt_unix.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_iter_setsockopt_unix.c [new file with mode: 0644]
tools/testing/selftests/bpf/progs/bpf_tracing_net.h