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: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/20240412141436.828666-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jakub Kicinski 2024-04-12 07:14:34 -07:00
parent eeb409bde9
commit 99583b970b

View File

@ -2,6 +2,7 @@
import builtins
import inspect
import traceback
from .consts import KSFT_MAIN_NAME
KSFT_RESULT = None
@ -85,7 +86,8 @@ def ksft_run(cases, args=()):
totals['xfail'] += 1
continue
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)
ktap_result(False, cnt, case)
totals['fail'] += 1