aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net/lib/py/load.py
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2024-04-29 14:44:23 +0000
committerJakub Kicinski <[email protected]>2024-04-30 15:15:32 +0000
commit32a4ca1361d7a51e5003d4af4dfbf570f1b5fd00 (patch)
treeae88dade4a4cc727704e96456e9c090eee7329c2 /tools/testing/selftests/drivers/net/lib/py/load.py
parentselftests: drv-net-hw: support using Python from net hw tests (diff)
downloadkernel-32a4ca1361d7a51e5003d4af4dfbf570f1b5fd00.tar.gz
kernel-32a4ca1361d7a51e5003d4af4dfbf570f1b5fd00.zip
selftests: net: py: extract tool logic
The main use of the ip() wrapper over cmd() is that it can parse JSON. cmd("ip -j link show") will return stdout as a string, and test has to call json.loads(). With ip("link show", json=True) the return value will be already parsed. More tools (ethtool, bpftool etc.) support the --json switch. To avoid having to wrap all of them individually create a tool() helper. Switch from -j to --json (for ethtool). While at it consume the netns attribute at the ip() level. Reviewed-by: Willem de Bruijn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/drivers/net/lib/py/load.py')
0 files changed, 0 insertions, 0 deletions