Skip to contentSkip to conversation

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

PATCH Superseded Alexey Gladkov 5 participants 7 messages Apr 27, 2023 – May 17, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests/bpf: Do not use sign-file as testcase

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")
---
 tools/testing/selftests/bpf/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +1 -2
index b677dcd0b77a..fd214d1526d4 100644
@@ -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);
Signature · 1 line
2.33.7
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Alexey Gladkov

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:

Quoted 8 lines

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")
Quoted 21 lines
---
 tools/testing/selftests/bpf/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +1 -2
index b677dcd0b77a..fd214d1526d4 100644
@@ -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);
Signature · 1 line
2.33.7
maintainer
#2 lore raw
Quoted 27 lines · Stanislav Fomichev
Quoted 4 lines · Alexey Gladkov

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:

Quoted 8 lines

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")
Quoted 11 lines
  tools/testing/selftests/bpf/Makefile | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +0 -0
index b677dcd0b77a..fd214d1526d4 100644
@@ -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
 
Quoted 3 lines

tools/testing/selftests/bpf/Makefile TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \ · line 91

Quoted 3 lines
tools/testing/selftests/bpf/Makefile +1 -2
-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) \

Quoted 5 lines
Quoted 5 lines
tools/testing/selftests/bpf/Makefile +0 -0
  # Emit succinct information message describing current building step
  # $1 - generic step name (e.g., CC, LINK, etc);
Signature · 1 line
2.33.7
#3 lore raw
Quoted 28 lines · Daniel Borkmann
Quoted 27 lines · Stanislav Fomichev
Quoted 4 lines · Alexey Gladkov

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:

Quoted 8 lines

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")
Quoted 11 lines
  tools/testing/selftests/bpf/Makefile | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +0 -0
index b677dcd0b77a..fd214d1526d4 100644
@@ -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
 
Quoted 6 lines
Quoted 3 lines

tools/testing/selftests/bpf/Makefile TEST_GEN_PROGS_EXTENDED = test_sock_addr test_skb_cgroup_id_user \ · line 91

Quoted 3 lines
tools/testing/selftests/bpf/Makefile +1 -2
-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.

Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
tools/testing/selftests/bpf/Makefile +0 -0
  # Emit succinct information message describing current building step
  # $1 - generic step name (e.g., CC, LINK, etc);
Signature · 1 line
2.33.7
Signature · 1 line
Rgrds, legion
Reviewed-by
#4 lore raw
In reply to Stanislav Fomichev
Quoted 8 lines · Stanislav Fomichev
Quoted 7 lines · Alexey Gladkov

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

Quoted 7 lines
Quoted 5 lines

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")

Thanks

Roberto

Quoted 21 lines
Quoted 21 lines
---
 tools/testing/selftests/bpf/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +1 -2
index b677dcd0b77a..fd214d1526d4 100644
@@ -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);
Signature · 1 line
2.33.7
#5 lore raw

PATCH RESEND 1/1 selftests/bpf: Do not use sign-file as testcase

In reply to Alexey Gladkov

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")
---
 tools/testing/selftests/bpf/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/testing/selftests/bpf/Makefile +1 -2
index b677dcd0b77a..fd214d1526d4 100644
@@ -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);
Signature · 1 line
2.33.8
#6 lore raw
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:

Quoted 8 lines · On Wed, 17 May 2023 11:49:46 +0200 you 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

[...]

Here is the summary with links:
- [RESEND,v1] selftests/bpf: Do not use sign-file as testcase

    https://git.kernel.org/bpf/bpf-next/c/f04a32b2c5b5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html