linux-stable/tools
Andrey Ignatov 9be71aa6e5 selftests/bpf: Prepare test_sock_addr for extension
test_sock_addr was not easy to extend since it was focused on sys_bind
and sys_connect quite a bit.

Reorganized it so that it'll be easier to cover new test-cases for
`BPF_PROG_TYPE_CGROUP_SOCK_ADDR`:

- decouple test-cases so that only one BPF prog is tested at a time;

- check programmatically that local IP:port for sys_bind, source IP and
  destination IP:port for sys_connect are rewritten property by tested
  BPF programs.

The output of new version:
  # test_sock_addr.sh 2>/dev/null
  Wait for testing IPv4/IPv6 to become available ... OK
  Test case: bind4: load prog with wrong expected attach type .. [PASS]
  Test case: bind4: attach prog with wrong attach type .. [PASS]
  Test case: bind4: rewrite IP & TCP port in .. [PASS]
  Test case: bind4: rewrite IP & UDP port in .. [PASS]
  Test case: bind6: load prog with wrong expected attach type .. [PASS]
  Test case: bind6: attach prog with wrong attach type .. [PASS]
  Test case: bind6: rewrite IP & TCP port in .. [PASS]
  Test case: bind6: rewrite IP & UDP port in .. [PASS]
  Test case: connect4: load prog with wrong expected attach type .. [PASS]
  Test case: connect4: attach prog with wrong attach type .. [PASS]
  Test case: connect4: rewrite IP & TCP port .. [PASS]
  Test case: connect4: rewrite IP & UDP port .. [PASS]
  Test case: connect6: load prog with wrong expected attach type .. [PASS]
  Test case: connect6: attach prog with wrong attach type .. [PASS]
  Test case: connect6: rewrite IP & TCP port .. [PASS]
  Test case: connect6: rewrite IP & UDP port .. [PASS]
  Summary: 16 PASSED, 0 FAILED

(stderr contains errors from libbpf when testing load/attach with
invalid arguments)

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-05-28 17:41:04 +02:00
..
accounting License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch tools headers kvm: Sync ARM UAPI headers with the kernel sources 2018-05-07 15:23:46 -03:00
bpf tools/bpftool: add perf subcommand 2018-05-24 18:18:20 -07:00
build Kbuild: fix # escaping in .cmd files for future Make 2018-04-11 00:03:02 +09:00
cgroup tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
firewire License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gpio Linux 4.16-rc5 2018-03-18 17:48:59 +01:00
hv tools: hv: include string.h in hv_fcopy_daemon 2018-03-06 09:57:16 -08:00
iio tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
include bpf: Sync bpf.h to tools/ 2018-05-28 17:41:02 +02:00
kvm/kvm_stat tools/kvm_stat: Remove unused function 2018-03-28 22:47:06 +02:00
laptop tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
leds tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
lib libbpf: Support guessing sendmsg{4,6} progs 2018-05-28 17:41:03 +02:00
memory-model tools/memory-model: Finish the removal of rb-dep, smp_read_barrier_depends(), and lockless_dereference() 2018-03-10 10:22:23 +01:00
nfsd License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
objtool objtool: Detect RIP-relative switch table references, part 2 2018-05-19 08:10:04 +02:00
pci License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pcmcia License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
perf perf tools: Add missing newline when parsing empty BPF proggie 2018-05-11 12:10:02 -03:00
power tools: power/acpi, revert to LD = gcc 2018-05-04 11:24:22 +02:00
scripts Kbuild: fix # escaping in .cmd files for future Make 2018-04-11 00:03:02 +09:00
spi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
testing selftests/bpf: Prepare test_sock_addr for extension 2018-05-28 17:41:04 +02:00
thermal/tmon tools/thermal: tmon: fix for segfault 2018-03-27 09:51:23 +02:00
time
usb usbip: tools: usbipd: exclude exported devices from exportable device list 2018-03-22 13:08:20 +01:00
virtio ptr_ring: fix build 2018-03-20 03:17:37 +02:00
vm tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
wmi tools: fix cross-compile var clobbering 2018-02-21 15:35:42 -08:00
Makefile platform-drivers-x86 for v4.15-1 2017-11-18 10:26:57 -08:00