diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-04-29 07:44:23 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-04-30 08:15:32 -0700 |
commit | 32a4ca1361d7a51e5003d4af4dfbf570f1b5fd00 (patch) | |
tree | ae88dade4a4cc727704e96456e9c090eee7329c2 /.gitattributes | |
parent | ff4b2bfa63bd07cca35f6e704dc5035650595950 (diff) |
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 <willemb@google.com>
Link: https://lore.kernel.org/r/20240429144426.743476-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '.gitattributes')
0 files changed, 0 insertions, 0 deletions