netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] selftests: drv-net: adjust tests before defaulting to shell=False
@ 2025-08-30 18:43 Jakub Kicinski
  2025-08-30 18:43 ` [PATCH net-next 2/2] selftests: net: py: don't default to shell=True Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jakub Kicinski @ 2025-08-30 18:43 UTC (permalink / raw)
  To: davem
  Cc: netdev, edumazet, pabeni, andrew+netdev, horms, joe, leitao, sdf,
	linux-kselftest, Jakub Kicinski

Clean up tests which expect shell=True without explicitly passing
that param to cmd(). There seems to be only one such case, and
in fact it's better converted to a direct write.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 tools/testing/selftests/drivers/net/napi_threaded.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/drivers/net/napi_threaded.py b/tools/testing/selftests/drivers/net/napi_threaded.py
index ed66efa481b0..f4be72b2145a 100755
--- a/tools/testing/selftests/drivers/net/napi_threaded.py
+++ b/tools/testing/selftests/drivers/net/napi_threaded.py
@@ -24,7 +24,8 @@ from lib.py import cmd, defer, ethtool
 
 
 def _set_threaded_state(cfg, threaded) -> None:
-    cmd(f"echo {threaded} > /sys/class/net/{cfg.ifname}/threaded")
+    with open(f"/sys/class/net/{cfg.ifname}/threaded", "wb") as fp:
+        fp.write(str(threaded).encode('utf-8'))
 
 
 def _setup_deferred_cleanup(cfg) -> None:
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-09-02 23:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-30 18:43 [PATCH net-next 1/2] selftests: drv-net: adjust tests before defaulting to shell=False Jakub Kicinski
2025-08-30 18:43 ` [PATCH net-next 2/2] selftests: net: py: don't default to shell=True Jakub Kicinski
2025-09-01  9:34   ` Breno Leitao
2025-09-01 17:38     ` Jakub Kicinski
2025-09-02  8:16   ` Breno Leitao
2025-09-01  9:04 ` [PATCH net-next 1/2] selftests: drv-net: adjust tests before defaulting to shell=False Breno Leitao
2025-09-02 23:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).