Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: net: py: explicitly forbid multiple ksft_run() calls

People (do people still write code or is it all AI?) seem to not
get that ksft_run() can only be called once. If we call it
multiple times KTAP parsers will likely cut off after the first
batch has finished.

Link: https://patch.msgid.link/20260408221952.819822-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+4 -1
+4 -1
tools/testing/selftests/net/lib/py/ksft.py
··· 341 341 342 342 totals = {"pass": 0, "fail": 0, "skip": 0, "xfail": 0} 343 343 344 + global KSFT_RESULT 345 + if KSFT_RESULT is not None: 346 + raise RuntimeError("ksft_run() can't be called multiple times.") 347 + 344 348 print("TAP version 13", flush=True) 345 349 print("1.." + str(len(test_cases)), flush=True) 346 350 347 - global KSFT_RESULT 348 351 cnt = 0 349 352 stop = False 350 353 for func, args, name in test_cases: