linux/tools/testing/selftests/bpf/prog_tests
Andrey Ignatov 257c88559f selftests/bpf: Convert test_cgroup_attach to prog_tests
Convert test_cgroup_attach to prog_tests.

This change does a lot of things but in many cases it's pretty expensive
to separate them, so they go in one commit. Nevertheless the logic is
ketp as is and changes made are just moving things around, simplifying
them (w/o changing the meaning of the tests) and making prog_tests
compatible:

* split the 3 tests in the file into 3 separate files in prog_tests/;

* rename the test functions to test_<file_base_name>;

* remove unused includes, constants, variables and functions from every
  test;

* replace `if`-s with or `if (CHECK())` where additional context should
  be logged and with `if (CHECK_FAIL())` where line number is enough;

* switch from `log_err()` to logging via `CHECK()`;

* replace `assert`-s with `CHECK_FAIL()` to avoid crashing the whole
  test_progs if one assertion fails;

* replace cgroup_helpers with test__join_cgroup() in
  cgroup_attach_override only, other tests need more fine-grained
  control for cgroup creation/deletion so cgroup_helpers are still used
  there;

* simplify cgroup_attach_autodetach by switching to easiest possible
  program since this test doesn't really need such a complicated program
  as cgroup_attach_multi does;

* remove test_cgroup_attach.c itself.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/0ff19cc64d2dc5cf404349f07131119480e10e32.1576741281.git.rdna@fb.com
2019-12-19 21:22:26 -08:00
..
.gitignore
attach_probe.c selftests/bpf: Fix test_attach_probe 2019-12-19 16:14:08 +01:00
bpf_obj_id.c selftests/bpf: test_progs: remove asserts from subtests 2019-08-28 00:35:40 +02:00
bpf_verif_scale.c selftests/bpf: Integrate verbose verifier log into test_progs 2019-11-24 16:58:45 -08:00
btf_dump.c selftests/bpf: Convert test_btf_dump into test_progs test 2019-10-09 15:38:36 -07:00
cgroup_attach_autodetach.c selftests/bpf: Convert test_cgroup_attach to prog_tests 2019-12-19 21:22:26 -08:00
cgroup_attach_multi.c selftests/bpf: Convert test_cgroup_attach to prog_tests 2019-12-19 21:22:26 -08:00
cgroup_attach_override.c selftests/bpf: Convert test_cgroup_attach to prog_tests 2019-12-19 21:22:26 -08:00
core_extern.c libbpf: Allow to augment system Kconfig through extra optional config 2019-12-18 17:33:36 -08:00
core_reloc.c selftests/bpf: Add flexible array relocation tests 2019-12-15 16:53:51 -08:00
cpu_mask.c selftests/bpf: Add CPU mask parsing tests 2019-12-13 12:59:55 -08:00
fentry_fexit.c bpftool, selftests/bpf: Embed object file inside skeleton 2019-12-17 22:16:35 -08:00
fentry_test.c bpftool, selftests/bpf: Embed object file inside skeleton 2019-12-17 22:16:35 -08:00
fexit_bpf2bpf.c selftests/bpf: Add a fexit/bpf2bpf test with target bpf prog no callees 2019-12-04 21:34:42 -08:00
fexit_stress.c selftests/bpf: Add stress test for maximum number of progs 2019-11-15 23:43:53 +01:00
fexit_test.c selftests/bpf: Add fexit tests for BPF trampoline 2019-11-15 23:43:28 +01:00
flow_dissector.c selftests/bpf: remove wrong nhoff in flow dissector test 2019-08-28 00:39:43 +02:00
flow_dissector_load_bytes.c selftests/bpf: add flow dissector bpf_skb_load_bytes helper test 2019-04-23 18:36:34 +02:00
flow_dissector_reattach.c selftests/bpf: Restore the netns after flow dissector reattach test 2019-10-17 12:10:16 -07:00
get_stack_raw_tp.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
global_data.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
kfree_skb.c selftest/bpf: Simple test for fentry/fexit 2019-11-15 23:42:46 +01:00
l4lb_all.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
map_lock.c selftests/bpf: test_progs: remove asserts from subtests 2019-08-28 00:35:40 +02:00
mmap.c bpftool, selftests/bpf: Embed object file inside skeleton 2019-12-17 22:16:35 -08:00
obj_name.c selftests: bpf: break up test_progs - misc 2019-03-02 11:10:40 -08:00
perf_buffer.c selftests/bpf: Fix perf_buffer test on systems w/ offline CPUs 2019-12-13 13:00:25 -08:00
pinning.c selftests/bpf: Add tests for automatic map unpinning on load failure 2019-11-10 19:26:30 -08:00
pkt_access.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
pkt_md_access.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
probe_user.c libbpf: Add generic bpf_program__attach() 2019-12-15 15:58:04 -08:00
prog_run_xattr.c selftests: bpf: break up test_progs - misc 2019-03-02 11:10:40 -08:00
queue_stack_map.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
raw_tp_writable_reject_nbd_invalid.c selftests: bpf: test writable buffers in raw tps 2019-04-26 19:04:19 -07:00
raw_tp_writable_test_run.c selftests: bpf: test writable buffers in raw tps 2019-04-26 19:04:19 -07:00
rdonly_maps.c libbpf: Expose BPF program's function name 2019-12-15 15:58:05 -08:00
reference_tracking.c libbpf: Make DECLARE_LIBBPF_OPTS macro strictly a variable declaration 2019-10-22 21:35:03 +02:00
section_names.c selftests/bpf: Move test_section_names into test_progs and fix it 2019-10-23 10:06:46 -07:00
select_reuseport.c selftests/bpf: Switch reuseport tests for test_progs framework 2019-12-13 12:38:00 -08:00
send_signal.c selftests/bpf: test_progs: remove unused ret 2019-08-28 00:35:40 +02:00
signal_pending.c selftests: bpf: test_progs: initialize duration in singal_pending test 2019-03-07 10:46:25 +01:00
skb_ctx.c bpf: Allow to change skb mark in test_run 2019-12-18 17:05:58 -08:00
skeleton.c libbpf: Put Kconfig externs into .kconfig section 2019-12-18 17:33:36 -08:00
sockopt.c selftests/bpf: test_progs: convert test_sockopt 2019-09-06 09:59:05 -07:00
sockopt_inherit.c selftests/bpf: test_progs: Don't leak server_fd in test_sockopt_inherit 2019-10-02 00:58:07 +02:00
sockopt_multi.c selftests/bpf: test_progs: convert test_sockopt_multi 2019-09-06 09:59:05 -07:00
sockopt_sk.c selftests/bpf: test_progs: convert test_sockopt_sk 2019-09-06 09:59:05 -07:00
spinlock.c selftests/bpf: test_progs: remove asserts from subtests 2019-08-28 00:35:40 +02:00
stacktrace_build_id.c bpftool, selftests/bpf: Embed object file inside skeleton 2019-12-17 22:16:35 -08:00
stacktrace_build_id_nmi.c bpftool, selftests/bpf: Embed object file inside skeleton 2019-12-17 22:16:35 -08:00
stacktrace_map.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
stacktrace_map_raw_tp.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
tailcalls.c bpf, testing: Add various tail call test cases 2019-11-24 17:04:12 -08:00
task_fd_query_rawtp.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
task_fd_query_tp.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
tcp_estats.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
tcp_rtt.c selftests/bpf: test_progs: Don't leak server_fd in tcp_rtt 2019-10-02 00:56:46 +02:00
test_overhead.c selftests/bpf: Add BPF trampoline performance test 2019-11-24 16:58:46 -08:00
tp_attach_query.c selftests: bpf: initialize bpf_object pointers where needed 2019-05-09 15:53:56 -07:00
xdp.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
xdp_adjust_tail.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
xdp_noinline.c selftests/bpf: test_progs: remove global fail/success counts 2019-08-28 00:35:40 +02:00
xdp_perf.c selftests: bpf: Add xdp_perf test 2019-12-13 13:09:32 -08:00