Skip to contentSkip to conversation

selftests: net: add more info to error in bpf_offload

PATCH Applied Jakub Kicinski 3 participants 3 messages Nov 15, 2024 – Nov 19, 2024

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 selftests: net: add more info to error in bpf_offload

bpf_offload caught a spurious warning in TC recently, but the error message did not provide enough information to know what the problem is:

FAIL: Found 'netdevsim' in command output, leaky extack?

Add the extack to the output:

FAIL: Unexpected command output, leaky extack? ('netdevsim', 'Warning: Filter with specified priority/protocol not found.')

---
 tools/testing/selftests/net/bpf_offload.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/testing/selftests/net/bpf_offload.py +3 -2
index 3efe44f6e92a..d10f420e4ef6 100755
@@ -594,8 +594,9 @@ def bpftool_prog_load(sample, file_name, maps=[], prog_type="xdp", dev=None,
     check_extack(output, "netdevsim: " + reference, args)
 
 def check_no_extack(res, needle):
-    fail((res[1] + res[2]).count(needle) or (res[1] + res[2]).count("Warning:"),
-         "Found '%s' in command output, leaky extack?" % (needle))
+    haystack = (res[1] + res[2]).strip()
+    fail(haystack.count(needle) or haystack.count("Warning:"),
+         "Unexpected command output, leaky extack? ('%s', '%s')" % (needle, haystack))
 
 def check_verifier_log(output, reference):
     lines = output.split("\n")
Signature · 1 line
2.47.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Jakub Kicinski

bpf_offload caught a spurious warning in TC recently, but the error message did not provide enough information to know what the problem is:

FAIL: Found 'netdevsim' in command output, leaky extack?

Add the extack to the output:

FAIL: Unexpected command output, leaky extack? ('netdevsim', 'Warning: Filter with specified priority/protocol not found.')

#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 15 Nov 2024 12:12:36 -0800 you wrote:

bpf_offload caught a spurious warning in TC recently, but the error message did not provide enough information to know what the problem is:

FAIL: Found 'netdevsim' in command output, leaky extack?

Add the extack to the output:

[...]

Here is the summary with links:
- [net-next] selftests: net: add more info to error in bpf_offload

    https://git.kernel.org/netdev/net-next/c/920efe3e13f7

You are awesome, thank you!

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