diff mbox series

[net-next] selftests: net: add more info to error in bpf_offload

Message ID 20241115201236.1011137-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 920efe3e13f7eb5711d4ad8ecc0cced16b1a84cf
Delegated to: Netdev Maintainers
Headers show
Series [net-next] selftests: net: add more info to error in bpf_offload | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
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: 3 this patch: 3
netdev/build_tools success Errors and warnings before: 0 (+0) this patch: 0 (+0)
netdev/cc_maintainers warning 4 maintainers not CCed: shuah@kernel.org linux-kselftest@vger.kernel.org bpf@vger.kernel.org horms@kernel.org
netdev/build_clang success Errors and warnings before: 3 this patch: 3
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 No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-15--21-00 (tests: 789)

Commit Message

Jakub Kicinski Nov. 15, 2024, 8:12 p.m. UTC
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.')

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/net/bpf_offload.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Stanislav Fomichev Nov. 16, 2024, 12:27 a.m. UTC | #1
On 11/15, Jakub Kicinski 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:
> 
>   FAIL: Unexpected command output, leaky extack? ('netdevsim', 'Warning: Filter with specified priority/protocol not found.')
> 
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
patchwork-bot+netdevbpf@kernel.org Nov. 19, 2024, 4 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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!
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/bpf_offload.py b/tools/testing/selftests/net/bpf_offload.py
index 3efe44f6e92a..d10f420e4ef6 100755
--- a/tools/testing/selftests/net/bpf_offload.py
+++ b/tools/testing/selftests/net/bpf_offload.py
@@ -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")