[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240402104439.4d833997@kernel.org>
Date: Tue, 2 Apr 2024 10:44:39 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: <davem@...emloft.net>, <netdev@...r.kernel.org>, <edumazet@...gle.com>,
<pabeni@...hat.com>, <shuah@...nel.org>, <sdf@...gle.com>,
<donald.hunter@...il.com>, <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH net-next 7/7] testing: net-drv: add a driver test for
stats reporting
On Tue, 2 Apr 2024 10:31:11 -0700 Jakub Kicinski wrote:
> Yes, I was wondering about that. It must be doable, IIRC
> the multi-threading API "injects" args from a tuple.
> I was thinking something along the lines of:
>
> with NetDrvEnv(__file__) as cfg:
> ksft_run([check_pause, check_fec, pkt_byte_sum],
> args=(cfg, ))
seems to work, is this good?
diff --git a/tools/testing/selftests/net/lib/py/ksft.py b/tools/testing/selftests/net/lib/py/ksft.py
index 7c296fe5e438..c7210525981c 100644
--- a/tools/testing/selftests/net/lib/py/ksft.py
+++ b/tools/testing/selftests/net/lib/py/ksft.py
@@ -60,7 +60,7 @@ KSFT_RESULT = None
print(res)
-def ksft_run(cases):
+def ksft_run(cases, args=()):
totals = {"pass": 0, "fail": 0, "skip": 0, "xfail": 0}
print("KTAP version 1")
@@ -72,7 +72,7 @@ KSFT_RESULT = None
KSFT_RESULT = True
cnt += 1
try:
- case()
+ case(*args)
except KsftSkipEx as e:
ktap_result(True, cnt, case, comment="SKIP " + str(e))
totals['skip'] += 1
Powered by blists - more mailing lists