Skip to content

Commit

Permalink
selftests: net: add more info to error in bpf_offload
Browse files Browse the repository at this point in the history
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.')

Acked-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Nov 19, 2024
1 parent 16a04d0 commit 920efe3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/testing/selftests/net/bpf_offload.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,9 @@ def check_extack_nsim(output, reference, args):
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")
Expand Down

0 comments on commit 920efe3

Please sign in to comment.