Andrii Nakryiko
8f6f41f393
selftests/bpf: Fix misaligned accesses in xdp and xdp_bpf2bpf tests
...
Similar to previous patch, just copy over necessary struct into local
stack variable before checking its fields.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Link: https://lore.kernel.org/bpf/20211124002325.1737739-14-andrii@kernel.org
2021-11-26 00:15:03 +01:00
Andrii Nakryiko
cbdb1461dc
selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere
...
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and
breaks when deprecation goes into effect due to macro magic. Convert all
the uses to explicit bpf_prog_test_load() calls which avoid deprecation
errors and makes everything less magical.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
Acked-by: Dave Marchevsky <davemarchevsky@fb.com >
Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org
2021-11-07 08:34:23 -08:00
Stanislav Fomichev
488a23b89d
selftests/bpf: Move existing common networking parts into network_helpers
...
1. Move pkt_v4 and pkt_v6 into network_helpers and adjust the users.
2. Copy-paste spin_lock_thread into two tests that use it.
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Martin KaFai Lau <kafai@fb.com >
Acked-by: Andrey Ignatov <rdna@fb.com >
Link: https://lore.kernel.org/bpf/20200508174611.228805-3-sdf@google.com
2020-05-09 00:48:20 +02:00
Stanislav Fomichev
d38835b75f
selftests/bpf: test_progs: remove global fail/success counts
...
Now that we have a global per-test/per-environment state, there
is no longer need to have global fail/success counters (and there
is no need to save/get the diff before/after the test).
Introduce CHECK_FAIL macro (suggested by Andrii) and covert existing tests
to it. CHECK_FAIL uses new test__fail() to record the failure.
Cc: Andrii Nakryiko <andriin@fb.com >
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
2019-08-28 00:35:40 +02:00
Stanislav Fomichev
eaf90740f5
selftests: bpf: break up test_progs - xdp
...
Move xdp prog tests into separate files.
Signed-off-by: Stanislav Fomichev <sdf@google.com >
Signed-off-by: Alexei Starovoitov <ast@kernel.org >
2019-03-02 11:10:40 -08:00