Commit 99583b97 authored by Jakub Kicinski's avatar Jakub Kicinski

selftests: net: print full exception on failure

Instead of a summary line print the full exception.
This makes debugging Python tests much easier.
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/20240412141436.828666-5-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent eeb409bd
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import builtins import builtins
import inspect import inspect
import traceback
from .consts import KSFT_MAIN_NAME from .consts import KSFT_MAIN_NAME
KSFT_RESULT = None KSFT_RESULT = None
...@@ -85,7 +86,8 @@ def ksft_run(cases, args=()): ...@@ -85,7 +86,8 @@ def ksft_run(cases, args=()):
totals['xfail'] += 1 totals['xfail'] += 1
continue continue
except Exception as e: except Exception as e:
for line in str(e).split('\n'): tb = traceback.format_exc()
for line in tb.strip().split('\n'):
ksft_pr("Exception|", line) ksft_pr("Exception|", line)
ktap_result(False, cnt, case) ktap_result(False, cnt, case)
totals['fail'] += 1 totals['fail'] += 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment