Skip to content

Commit 920efe3

Browse files
committed
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.') Acked-by: Stanislav Fomichev <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 16a04d0 commit 920efe3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/testing/selftests/net/bpf_offload.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,9 @@ def check_extack_nsim(output, reference, args):
594594
check_extack(output, "netdevsim: " + reference, args)
595595

596596
def check_no_extack(res, needle):
597-
fail((res[1] + res[2]).count(needle) or (res[1] + res[2]).count("Warning:"),
598-
"Found '%s' in command output, leaky extack?" % (needle))
597+
haystack = (res[1] + res[2]).strip()
598+
fail(haystack.count(needle) or haystack.count("Warning:"),
599+
"Unexpected command output, leaky extack? ('%s', '%s')" % (needle, haystack))
599600

600601
def check_verifier_log(output, reference):
601602
lines = output.split("\n")

0 commit comments

Comments
 (0)