linux-stable/tools/testing/selftests/bpf
Andrey Ignatov 7568f4cbbe selftests/bpf: C based test for sysctl and strtoX
Add C based test for a few bpf_sysctl_* helpers and bpf_strtoul.

Make sure that sysctl can be identified by name and that multiple
integers can be parsed from sysctl value with bpf_strtoul.

net/ipv4/tcp_mem is chosen as a testing sysctl, it contains 3 unsigned
longs, they all are parsed and compared (val[0] < val[1] < val[2]).

Example of output:
  # ./test_sysctl
  ...
  Test case: C prog: deny all writes .. [PASS]
  Test case: C prog: deny access by name .. [PASS]
  Test case: C prog: read tcp_mem .. [PASS]
  Summary: 39 PASSED, 0 FAILED

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-04-12 13:54:59 -07:00
..
gnu
include/uapi/linux
prog_tests Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-04-11 17:00:05 -07:00
progs selftests/bpf: C based test for sysctl and strtoX 2019-04-12 13:54:59 -07:00
verifier selftests/bpf: Test ARG_PTR_TO_LONG arg type 2019-04-12 13:54:59 -07:00
.gitignore selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcp 2019-03-21 18:59:11 -07:00
Makefile selftests/bpf: Test BPF_CGROUP_SYSCTL 2019-04-12 13:54:58 -07:00
bpf_endian.h
bpf_helpers.h selftests/bpf: Add sysctl and strtoX helpers to bpf_helpers.h 2019-04-12 13:54:59 -07:00
bpf_rand.h
bpf_rlimit.h
bpf_util.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-02-16 22:56:34 -08:00
cgroup_helpers.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
cgroup_helpers.h selftests/bpf: Fix const'ness in cgroup_helpers 2018-07-15 00:08:41 +02:00
config selftests_bpf: add L2 encap to test_tc_tunnel 2019-04-11 22:50:57 +02:00
flow_dissector_load.c selftests: bpf: fix -Wformat-security warning for flow_dissector_load.c 2019-04-02 23:17:18 +02:00
flow_dissector_load.h selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow dissector 2019-01-29 01:08:29 +01:00
get_cgroup_id_user.c tools/bpf: fix selftest get_cgroup_id_user 2018-06-08 00:10:07 +02:00
netcnt_common.h selftests/bpf: cgroup local storage-based network counters 2018-10-01 16:18:33 +02:00
tcp_client.py selftests/bpf: use localhost in tcp_{server,client}.py 2019-02-04 21:29:27 +01:00
tcp_server.py selftests/bpf: use localhost in tcp_{server,client}.py 2019-02-04 21:29:27 +01:00
test_align.c bpf: Add BPF_F_ANY_ALIGNMENT. 2018-11-30 21:38:48 -08:00
test_btf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-04-11 17:00:05 -07:00
test_cgroup_storage.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_dev_cgroup.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_flow_dissector.c selftests: bpf: remove duplicated include 2019-01-29 00:09:26 +01:00
test_flow_dissector.sh selftests/bpf: rename flow dissector section to flow_dissector 2018-11-10 15:56:10 -08:00
test_iptunnel_common.h
test_kmod.sh selftests: bpf: notification about privilege required to run test_kmod.sh testing script 2018-06-22 00:30:02 +02:00
test_libbpf.sh selftests/bpf: enable (uncomment) all tests in test_libbpf.sh 2018-11-07 22:20:56 +01:00
test_libbpf_open.c tools: libbpf: add a correctly named define for map iteration 2019-03-01 00:53:45 +01:00
test_lirc_mode2.sh media: bpf: add bpf function to report mouse movement 2018-12-09 14:37:18 -08:00
test_lirc_mode2_user.c media: bpf: add bpf function to report mouse movement 2018-12-09 14:37:18 -08:00
test_lpm_map.c bpf, lpm: fix lookup bug in map_delete_elem 2019-02-22 16:17:53 +01:00
test_lru_map.c
test_lwt_ip_encap.sh selftests/bpf: test that GSO works in lwt_ip_encap 2019-03-07 10:41:40 +01:00
test_lwt_seg6local.sh selftests/bpf: update test_lwt_seg6local.sh according to iproute2 2018-08-03 10:19:33 +02:00
test_maps.c bpf: test_maps: fix possible out of bound access warning 2019-02-06 15:48:43 +01:00
test_netcnt.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_offload.py selftests/bpf: test reading the offloaded program 2019-02-06 15:35:42 +01:00
test_progs.c selftests/bpf: add few verifier scale tests 2019-04-04 01:27:38 +02:00
test_progs.h selftests/bpf: add few verifier scale tests 2019-04-04 01:27:38 +02:00
test_queue_stack_map.h selftests/bpf: add test cases for queue and stack maps 2018-10-19 13:24:31 -07:00
test_section_names.c selftests/bpf: Test sysctl section name 2019-04-12 13:54:58 -07:00
test_select_reuseport.c bpf: Test BPF_PROG_TYPE_SK_REUSEPORT 2018-08-11 01:58:46 +02:00
test_select_reuseport_common.h bpf: Test BPF_PROG_TYPE_SK_REUSEPORT 2018-08-11 01:58:46 +02:00
test_skb_cgroup_id.sh kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists 2018-10-31 23:05:30 +01:00
test_skb_cgroup_id_user.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_sock.c tools/bpf: add log_level to bpf_load_program_attr 2019-02-07 18:22:31 -08:00
test_sock_addr.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_sock_addr.sh kselftests/bpf: use ping6 as the default ipv6 ping binary if it exists 2018-10-31 23:05:30 +01:00
test_sock_fields.c bpf: Add an example for bpf_get_listener_sock 2019-03-13 12:04:35 -07:00
test_socket_cookie.c libbpf: Show supported ELF section names when failing to guess prog/attach type 2019-01-23 12:27:04 +01:00
test_sockmap.c selftests: bpf: remove duplicated include 2019-01-29 00:09:26 +01:00
test_sockmap_kern.h bpf: test_sockmap, add options for msg_pop_data() helper 2018-11-28 22:07:57 +01:00
test_sysctl.c selftests/bpf: C based test for sysctl and strtoX 2019-04-12 13:54:59 -07:00
test_tag.c
test_tc_edt.sh selftests: bpf: tc-bpf flow shaping with EDT 2019-03-22 18:16:44 -07:00
test_tc_tunnel.sh selftests_bpf: add L2 encap to test_tc_tunnel 2019-04-11 22:50:57 +02:00
test_tcp_check_syncookie.sh selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcp 2019-03-21 18:59:11 -07:00
test_tcp_check_syncookie_user.c selftests/bpf: add tests for bpf_tcp_check_syncookie and bpf_skc_lookup_tcp 2019-03-21 18:59:11 -07:00
test_tcpbpf.h selftests/bpf: Test case for BPF_SOCK_OPS_TCP_LISTEN_CB 2018-07-15 00:08:41 +02:00
test_tcpbpf_user.c selftests/bpf: fix incorrect users of create_and_get_cgroup 2019-01-07 13:15:55 -08:00
test_tcpnotify.h selftests/bpf: add a test case for sock_ops perf-event notification 2018-11-09 09:40:17 +01:00
test_tcpnotify_user.c selftests/bpf: don't hardcode iptables/nc path in test_tcpnotify_user 2019-01-23 12:56:30 +01:00
test_tunnel.sh bpf, selftests: delete xfrm tunnel when test exits. 2018-06-15 03:31:52 +02:00
test_verifier.c bpf, selftest: test {rd, wr}only flags and direct value access 2019-04-09 17:05:47 -07:00
test_verifier_log.c
test_xdp_meta.sh
test_xdp_redirect.sh
test_xdp_vlan.sh selftests/bpf: add XDP selftests for modifying and popping VLAN headers 2018-10-09 21:59:09 -07:00
trace_helpers.c selftests/bpf: ksym_search won't check symbols exists 2019-04-04 16:43:46 +02:00
trace_helpers.h trace_helpers.c: Add helpers to poll multiple perf FDs for events 2018-06-27 11:01:03 +02:00
urandom_read.c selftests: bpf: modify urandom_read and link it non-statically 2019-03-21 19:37:30 -07:00
with_addr.sh selftests/bpf: test bpf flow dissection 2018-09-14 12:04:33 -07:00
with_tunnels.sh selftests/bpf: test bpf flow dissection 2018-09-14 12:04:33 -07:00