linux/tools/testing/selftests/bpf
Yonghong Song 0a0a7e00a2 tools/bpf: fix test_sock and test_sock_addr.sh failure
The bpf selftests test_sock and test_sock_addr.sh failed
in my test machine. The failure looks like:
    $ ./test_sock
    Test case: bind4 load with invalid access: src_ip6 .. [PASS]
    Test case: bind4 load with invalid access: mark .. [PASS]
    Test case: bind6 load with invalid access: src_ip4 .. [PASS]
    Test case: sock_create load with invalid access: src_port .. [PASS]
    Test case: sock_create load w/o expected_attach_type (compat mode) .. [FAIL]
    Test case: sock_create load w/ expected_attach_type .. [FAIL]
    Test case: attach type mismatch bind4 vs bind6 .. [FAIL]
    ...
    Summary: 4 PASSED, 12 FAILED
    $ ./test_sock_addr.sh
    Wait for testing IPv4/IPv6 to become available .....
    ERROR: Timeout waiting for test IP to become available.

In test_sock, bpf program loads failed due to hitting memlock limits.
In test_sock_addr.sh, my test machine is a ipv6 only test box and using
"ping" without specifying address family for an ipv6 address does not work.

This patch fixed the issue by including header bpf_rlimit.h in test_sock.c
and test_sock_addr.c, and specifying address family for ping command.

Cc: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2018-04-19 00:16:37 +02:00
..
gnu selftests/bpf: get rid of -D__x86_64__ 2017-05-03 09:51:25 -04:00
include/uapi/linux License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
.gitignore selftests: bpf: update .gitignore with missing generated files 2018-04-11 00:59:30 +02:00
bpf_endian.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bpf_helpers.h selftests/bpf: Selftest for sys_connect hooks 2018-03-31 02:16:14 +02:00
bpf_rlimit.h bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
bpf_util.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cgroup_helpers.c bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/ 2017-11-05 23:26:51 +09:00
cgroup_helpers.h bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/ 2017-11-05 23:26:51 +09:00
config selftests/bpf: add netdevsim to config 2017-12-19 01:35:12 +01:00
connect4_prog.c selftests/bpf: Selftest for sys_connect hooks 2018-03-31 02:16:14 +02:00
connect6_prog.c selftests/bpf: Selftest for sys_connect hooks 2018-03-31 02:16:14 +02:00
dev_cgroup.c selftests/bpf: add a test for device cgroup controller 2017-11-05 23:26:51 +09:00
Makefile selftests/bpf: Selftest for sys_bind post-hooks. 2018-03-31 02:16:40 +02:00
sample_map_ret0.c selftest/bpf: extend the offload test with map checks 2018-01-18 22:54:26 +01:00
sample_ret0.c selftests/bpf: add offload test based on netdevsim 2017-12-03 00:27:58 +01:00
sockmap_parse_prog.c bpf: add map tests for BPF_PROG_TYPE_SK_MSG 2018-03-19 21:14:39 +01:00
sockmap_tcp_msg_prog.c bpf: add map tests for BPF_PROG_TYPE_SK_MSG 2018-03-19 21:14:39 +01:00
sockmap_verdict_prog.c bpf: add map tests for BPF_PROG_TYPE_SK_MSG 2018-03-19 21:14:39 +01:00
tcp_client.py bpf: add selftest for tcpbpf 2018-01-25 16:41:15 -08:00
tcp_server.py bpf: add selftest for tcpbpf 2018-01-25 16:41:15 -08:00
test_align.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_dev_cgroup.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_iptunnel_common.h selftests/bpf: add a test for basic XDP functionality 2017-04-01 12:45:57 -07:00
test_kmod.sh selftests: bpf: test_kmod.sh: check the module path before insmod 2018-02-08 00:24:55 +01:00
test_l4lb_noinline.c selftests/bpf: add bpf_call test 2017-12-17 20:34:36 +01:00
test_l4lb.c bpf: Move endianness BPF helpers out of bpf_util.h 2017-05-01 12:43:49 -07:00
test_libbpf_open.c selftests/bpf: add test program for loading BPF ELF files 2018-02-09 00:24:38 +01:00
test_libbpf.sh selftests/bpf: add selftest that use test_libbpf_open 2018-02-09 00:25:12 +01:00
test_lpm_map.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_lru_map.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_maps.c bpf: add map tests for BPF_PROG_TYPE_SK_MSG 2018-03-19 21:14:39 +01:00
test_obj_id.c bpf: Fix test_obj_id.c for llvm 5.0 2017-06-09 15:15:11 -04:00
test_offload.py selftests/bpf: check for chain-non-0 extack message 2018-01-25 21:23:09 -05:00
test_pkt_access.c selftests/bpf: fix broken build due to types.h 2017-05-17 18:45:14 -04:00
test_pkt_md_access.c bpf: fix selftest/bpf/test_pkt_md_access on s390x 2017-08-07 10:06:27 -07:00
test_progs.c selftests/bpf: test for bpf_get_stackid() from raw tracepoints 2018-03-28 22:55:19 +02:00
test_sock_addr.c tools/bpf: fix test_sock and test_sock_addr.sh failure 2018-04-19 00:16:37 +02:00
test_sock_addr.sh tools/bpf: fix test_sock and test_sock_addr.sh failure 2018-04-19 00:16:37 +02:00
test_sock.c tools/bpf: fix test_sock and test_sock_addr.sh failure 2018-04-19 00:16:37 +02:00
test_stacktrace_build_id.c bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID 2018-03-15 01:10:02 +01:00
test_stacktrace_map.c tools/bpf: add a bpf selftest for stacktrace 2018-01-06 23:52:23 +01:00
test_tag.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_tcp_estats.c selftests/bpf: add a test case to check verifier pointer arithmetic 2017-05-03 09:51:25 -04:00
test_tcpbpf_kern.c selftests/bpf: tcpbpf_kern: use in6_* macros from glibc 2018-02-22 01:19:37 +01:00
test_tcpbpf_user.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_tcpbpf.h bpf: add selftest for tcpbpf 2018-01-25 16:41:15 -08:00
test_tracepoint.c bpf/tracing: add a bpf test for new ioctl query interface 2017-12-12 08:46:40 -08:00
test_verifier_log.c bpf: unify rlimit handling in selftests 2018-02-26 20:11:23 -08:00
test_verifier.c bpf: add verifier tests for BPF_PROG_TYPE_SK_MSG 2018-03-19 21:14:39 +01:00
test_xdp_meta.c bpf: improve selftests and add tests for meta pointer 2017-09-26 13:36:44 -07:00
test_xdp_meta.sh tools/bpf: fix batch-mode test failure of test_xdp_redirect.sh 2018-02-06 11:34:42 +01:00
test_xdp_noinline.c selftests/bpf: add xdp noinline test 2017-12-17 20:34:36 +01:00
test_xdp_redirect.c selftests: bpf: add a test for XDP redirect 2017-08-08 18:12:50 -07:00
test_xdp_redirect.sh tools/bpf: fix batch-mode test failure of test_xdp_redirect.sh 2018-02-06 11:34:42 +01:00
test_xdp.c selftests: bpf: Use bpf_endian.h in test_xdp.c 2017-05-02 07:52:01 -07:00
urandom_read.c bpf: add selftest for stackmap with BPF_F_STACK_BUILD_ID 2018-03-15 01:10:02 +01:00