selftests: net: print report check location in python tests
authorJakub Kicinski <kuba@kernel.org>
Fri, 12 Apr 2024 14:14:33 +0000 (07:14 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 15 Apr 2024 18:21:12 +0000 (11:21 -0700)
commiteeb409bde964df1956297b6775ff5f53dd98d556
tree722e3e14deeffa318c5f62ec8b1f48d2869fa64b
parent72ba6cba0a6e9f06c09187ddbbdc9f80ee93ffb3
selftests: net: print report check location in python tests

Developing Python tests is a bit annoying because when test fails
we only print the fail message and no info about which exact check
led to it. Print the location (the first line of this example is new):

  # At /root/ksft-net-drv/./net/nl_netdev.py line 38:
  # Check failed 0 != 10
  not ok 3 nl_netdev.page_pool_check

Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/20240412141436.828666-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/net/lib/py/ksft.py