diff mbox series

[bpf-next] selftests/bpf: skip module_fentry_shadow test when bpf_testmod is not available

Message ID 20230914124928.340701-1-asavkov@redhat.com (mailing list archive)
State Accepted
Commit 971f7c32147f2d0953a815a109b22b8ed45949d4
Delegated to: BPF
Headers show
Series [bpf-next] selftests/bpf: skip module_fentry_shadow test when bpf_testmod is not available | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers fail 1 blamed authors not CCed: jolsa@kernel.org; 11 maintainers not CCed: linux-kselftest@vger.kernel.org shuah@kernel.org martin.lau@linux.dev jolsa@kernel.org haoluo@google.com kpsingh@kernel.org sdf@google.com john.fastabend@gmail.com yonghong.song@linux.dev mykolal@fb.com song@kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch fail ERROR: code indent should use tabs where possible WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: aa3d65de4b90 ("bpf/selftests: Test fentry attachment to shadowed functions")' WARNING: please, no spaces at the start of a line
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_verifier on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-15 success Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-7 success Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-0 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-1 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-5 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-21 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for veristat
bpf/vmtest-bpf-next-VM_Test-18 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 success Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-10 success Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-13 success Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-16 success Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-20 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-17 success Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-19 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-22 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_verifier on x86_64 with llvm-16

Commit Message

Artem Savkov Sept. 14, 2023, 12:49 p.m. UTC
This test relies on bpf_testmod, so skip it if the module is not available.

Fixes: aa3d65de4b900 ("bpf/selftests: Test fentry attachment to shadowed functions")
Signed-off-by: Artem Savkov <asavkov@redhat.com>
---
 .../testing/selftests/bpf/prog_tests/module_fentry_shadow.c  | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Andrii Nakryiko Sept. 14, 2023, 6:17 p.m. UTC | #1
On Thu, Sep 14, 2023 at 5:49 AM Artem Savkov <asavkov@redhat.com> wrote:
>
> This test relies on bpf_testmod, so skip it if the module is not available.
>
> Fixes: aa3d65de4b900 ("bpf/selftests: Test fentry attachment to shadowed functions")
> Signed-off-by: Artem Savkov <asavkov@redhat.com>
> ---
>  .../testing/selftests/bpf/prog_tests/module_fentry_shadow.c  | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c b/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
> index c7636e18b1ebd..cdd55e5340dec 100644
> --- a/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
> +++ b/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
> @@ -61,6 +61,11 @@ void test_module_fentry_shadow(void)
>         int link_fd[2] = {};
>         __s32 btf_id[2] = {};
>
> +        if (!env.has_testmod) {
> +                test__skip();
> +                return;
> +        }
> +

you used spaces for indentation, please don't do that. It was also
obvious if you looked at patchworks status ([0]). I fixed it up while
applying, but keep this in mind for the future. Thanks.

  [0] https://patchwork.kernel.org/project/netdevbpf/patch/20230914124928.340701-1-asavkov@redhat.com/

>         LIBBPF_OPTS(bpf_prog_load_opts, load_opts,
>                 .expected_attach_type = BPF_TRACE_FENTRY,
>         );
> --
> 2.41.0
>
patchwork-bot+netdevbpf@kernel.org Sept. 14, 2023, 6:20 p.m. UTC | #2
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@kernel.org>:

On Thu, 14 Sep 2023 14:49:28 +0200 you wrote:
> This test relies on bpf_testmod, so skip it if the module is not available.
> 
> Fixes: aa3d65de4b900 ("bpf/selftests: Test fentry attachment to shadowed functions")
> Signed-off-by: Artem Savkov <asavkov@redhat.com>
> ---
>  .../testing/selftests/bpf/prog_tests/module_fentry_shadow.c  | 5 +++++
>  1 file changed, 5 insertions(+)

Here is the summary with links:
  - [bpf-next] selftests/bpf: skip module_fentry_shadow test when bpf_testmod is not available
    https://git.kernel.org/bpf/bpf-next/c/971f7c32147f

You are awesome, thank you!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c b/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
index c7636e18b1ebd..cdd55e5340dec 100644
--- a/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
+++ b/tools/testing/selftests/bpf/prog_tests/module_fentry_shadow.c
@@ -61,6 +61,11 @@  void test_module_fentry_shadow(void)
 	int link_fd[2] = {};
 	__s32 btf_id[2] = {};
 
+        if (!env.has_testmod) {
+                test__skip();
+                return;
+        }
+
 	LIBBPF_OPTS(bpf_prog_load_opts, load_opts,
 		.expected_attach_type = BPF_TRACE_FENTRY,
 	);