diff mbox series

[v1] selftests/bpf: Do not use sign-file as testcase

Message ID 88e3ab23029d726a2703adcf6af8356f7a2d3483.1682607419.git.legion@kernel.org (mailing list archive)
State Changes Requested
Delegated to: BPF
Headers show
Series [v1] selftests/bpf: Do not use sign-file as testcase | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-1 success Logs for ShellCheck
bpf/vmtest-bpf-next-VM_Test-2 success Logs for build for aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-3 success Logs for build for aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-5 success Logs for build for x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-6 success Logs for build for x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-7 success Logs for set-matrix
bpf/vmtest-bpf-next-VM_Test-4 success Logs for build for s390x with gcc
bpf/vmtest-bpf-next-VM_Test-8 success Logs for test_maps on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-9 success Logs for test_maps on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-10 pending Logs for test_maps on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-11 success Logs for test_maps on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-12 success Logs for test_maps on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-13 fail Logs for test_progs on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-14 fail Logs for test_progs on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-15 pending Logs for test_progs on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-16 fail Logs for test_progs on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-17 fail Logs for test_progs on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-18 fail Logs for test_progs_no_alu32 on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-19 fail Logs for test_progs_no_alu32 on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-21 fail Logs for test_progs_no_alu32 on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-22 fail Logs for test_progs_no_alu32 on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-23 success Logs for test_progs_no_alu32_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-24 success Logs for test_progs_no_alu32_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-25 success Logs for test_progs_no_alu32_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-26 success Logs for test_progs_no_alu32_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-27 success Logs for test_progs_parallel on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-28 success Logs for test_progs_parallel on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-29 success Logs for test_progs_parallel on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-30 success Logs for test_progs_parallel on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-31 success Logs for test_verifier on aarch64 with gcc
bpf/vmtest-bpf-next-VM_Test-32 success Logs for test_verifier on aarch64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-34 success Logs for test_verifier on x86_64 with gcc
bpf/vmtest-bpf-next-VM_Test-35 success Logs for test_verifier on x86_64 with llvm-16
bpf/vmtest-bpf-next-VM_Test-36 success Logs for veristat
bpf/vmtest-bpf-next-VM_Test-20 fail Logs for test_progs_no_alu32 on s390x with gcc
bpf/vmtest-bpf-next-VM_Test-33 success Logs for test_verifier on s390x with gcc

Commit Message

Alexey Gladkov April 27, 2023, 2:59 p.m. UTC
The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c,
but the utility should not be called as a test. Executing this utility
produces the following error:

selftests: /linux/tools/testing/selftests/bpf: urandom_read
ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read

selftests: /linux/tools/testing/selftests/bpf: sign-file
not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2

Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
Signed-off-by: Alexey Gladkov <legion@kernel.org>
---
 tools/testing/selftests/bpf/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Stanislav Fomichev April 27, 2023, 6:28 p.m. UTC | #1
On 04/27, Alexey Gladkov wrote:
> The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c,
> but the utility should not be called as a test. Executing this utility
> produces the following error:
> 
> selftests: /linux/tools/testing/selftests/bpf: urandom_read
> ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read
> 
> selftests: /linux/tools/testing/selftests/bpf: sign-file
> not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2
> 
> Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
> Signed-off-by: Alexey Gladkov <legion@kernel.org>

Acked-by: Stanislav Fomichev <sdf@google.com>

> ---
>  tools/testing/selftests/bpf/Makefile | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index b677dcd0b77a..fd214d1526d4 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -88,8 +88,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
>  	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
>  	xdp_features
>  
> -TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
> -TEST_GEN_FILES += liburandom_read.so
> +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
>  
>  # Emit succinct information message describing current building step
>  # $1 - generic step name (e.g., CC, LINK, etc);
> -- 
> 2.33.7
>
Daniel Borkmann April 27, 2023, 8:38 p.m. UTC | #2
On 4/27/23 8:28 PM, Stanislav Fomichev wrote:
> On 04/27, Alexey Gladkov wrote:
>> The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c,
>> but the utility should not be called as a test. Executing this utility
>> produces the following error:
>>
>> selftests: /linux/tools/testing/selftests/bpf: urandom_read
>> ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read
>>
>> selftests: /linux/tools/testing/selftests/bpf: sign-file
>> not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2
>>
>> Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
>> Signed-off-by: Alexey Gladkov <legion@kernel.org>
> 
> Acked-by: Stanislav Fomichev <sdf@google.com>
> 
>>   tools/testing/selftests/bpf/Makefile | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
>> index b677dcd0b77a..fd214d1526d4 100644
>> --- a/tools/testing/selftests/bpf/Makefile
>> +++ b/tools/testing/selftests/bpf/Makefile
>> @@ -88,8 +88,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
>>   	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
>>   	xdp_features
>>   
>> -TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
>> -TEST_GEN_FILES += liburandom_read.so
>> +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file

Given you move over both of them, the commit msg should be adapted accordingly
since it mainly talks about sign-file, less so about urandom_read.

Also now that you remove the TEST_CUSTOM_PROGS, we should probably also remove
the other two instances:

tools/testing/selftests/bpf/Makefile:91:TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
tools/testing/selftests/bpf/Makefile:156:        $(TEST_CUSTOM_PROGS)): %: $(OUTPUT)/% ;
tools/testing/selftests/bpf/Makefile:674:EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \

>>   # Emit succinct information message describing current building step
>>   # $1 - generic step name (e.g., CC, LINK, etc);
>> -- 
>> 2.33.7
>>
Roberto Sassu April 28, 2023, 7:14 a.m. UTC | #3
On Thu, 2023-04-27 at 11:28 -0700, Stanislav Fomichev wrote:
> On 04/27, Alexey Gladkov wrote:
> > The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c,
> > but the utility should not be called as a test. Executing this utility
> > produces the following error:
> > 
> > selftests: /linux/tools/testing/selftests/bpf: urandom_read
> > ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read
> > 
> > selftests: /linux/tools/testing/selftests/bpf: sign-file
> > not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2
> > 
> > Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
> > Signed-off-by: Alexey Gladkov <legion@kernel.org>
> 
> Acked-by: Stanislav Fomichev <sdf@google.com>

Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>

Thanks

Roberto

> > ---
> >  tools/testing/selftests/bpf/Makefile | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > index b677dcd0b77a..fd214d1526d4 100644
> > --- a/tools/testing/selftests/bpf/Makefile
> > +++ b/tools/testing/selftests/bpf/Makefile
> > @@ -88,8 +88,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
> >  	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
> >  	xdp_features
> >  
> > -TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
> > -TEST_GEN_FILES += liburandom_read.so
> > +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
> >  
> >  # Emit succinct information message describing current building step
> >  # $1 - generic step name (e.g., CC, LINK, etc);
> > -- 
> > 2.33.7
> >
Alexey Gladkov April 28, 2023, 9:47 a.m. UTC | #4
On Thu, Apr 27, 2023 at 10:38:50PM +0200, Daniel Borkmann wrote:
> On 4/27/23 8:28 PM, Stanislav Fomichev wrote:
> > On 04/27, Alexey Gladkov wrote:
> >> The sign-file utility (from scripts/) is used in prog_tests/verify_pkcs7_sig.c,
> >> but the utility should not be called as a test. Executing this utility
> >> produces the following error:
> >>
> >> selftests: /linux/tools/testing/selftests/bpf: urandom_read
> >> ok 16 selftests: /linux/tools/testing/selftests/bpf: urandom_read
> >>
> >> selftests: /linux/tools/testing/selftests/bpf: sign-file
> >> not ok 17 selftests: /linux/tools/testing/selftests/bpf: sign-file # exit=2
> >>
> >> Fixes: fc97590668ae ("selftests/bpf: Add test for bpf_verify_pkcs7_signature() kfunc")
> >> Signed-off-by: Alexey Gladkov <legion@kernel.org>
> > 
> > Acked-by: Stanislav Fomichev <sdf@google.com>
> > 
> >>   tools/testing/selftests/bpf/Makefile | 3 +--
> >>   1 file changed, 1 insertion(+), 2 deletions(-)
> >>
> >> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> >> index b677dcd0b77a..fd214d1526d4 100644
> >> --- a/tools/testing/selftests/bpf/Makefile
> >> +++ b/tools/testing/selftests/bpf/Makefile
> >> @@ -88,8 +88,7 @@ TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
> >>   	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
> >>   	xdp_features
> >>   
> >> -TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
> >> -TEST_GEN_FILES += liburandom_read.so
> >> +TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
> 
> Given you move over both of them, the commit msg should be adapted accordingly
> since it mainly talks about sign-file, less so about urandom_read.

I mentioned urandom_read only in the example of output because this
utility is less critical. Although it is mistakenly used as a test, it
does not lead to an error.

First I found sign-file and only then I noticed that urandom_read is not a
test either.

> Also now that you remove the TEST_CUSTOM_PROGS, we should probably also remove
> the other two instances:
> 
> tools/testing/selftests/bpf/Makefile:91:TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file

My patch just changed it.

> tools/testing/selftests/bpf/Makefile:156:        $(TEST_CUSTOM_PROGS)): %: $(OUTPUT)/% ;
> tools/testing/selftests/bpf/Makefile:674:EXTRA_CLEAN := $(TEST_CUSTOM_PROGS) $(SCRATCH_DIR) $(HOST_SCRATCH_DIR) \

I thought about it.

According to the documentation TEST_CUSTOM_PROGS should be used by tests
that require custom build rule and common prevent build rule use.

These rules provide a custom build of utilities. Therefore, I left it
unchanged in case such tests actually appear.

> >>   # Emit succinct information message describing current building step
> >>   # $1 - generic step name (e.g., CC, LINK, etc);
> >> -- 
> >> 2.33.7
> >>
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index b677dcd0b77a..fd214d1526d4 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -88,8 +88,7 @@  TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \
 	xskxceiver xdp_redirect_multi xdp_synproxy veristat xdp_hw_metadata \
 	xdp_features
 
-TEST_CUSTOM_PROGS = $(OUTPUT)/urandom_read $(OUTPUT)/sign-file
-TEST_GEN_FILES += liburandom_read.so
+TEST_GEN_FILES += liburandom_read.so urandom_read sign-file
 
 # Emit succinct information message describing current building step
 # $1 - generic step name (e.g., CC, LINK, etc);