aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net/hw/devmem.py
diff options
context:
space:
mode:
authorJakub Kicinski <[email protected]>2025-02-18 22:54:25 +0000
committerJakub Kicinski <[email protected]>2025-02-20 03:08:50 +0000
commitde94e8697405112b48c2cb8ee6ebe7c873e48f50 (patch)
tree22d1e42646dffe19cd941f4655ce397b4c55d275 /tools/testing/selftests/drivers/net/hw/devmem.py
parentselftests: drv-net: get detailed interface info (diff)
downloadkernel-de94e8697405112b48c2cb8ee6ebe7c873e48f50.tar.gz
kernel-de94e8697405112b48c2cb8ee6ebe7c873e48f50.zip
selftests: drv-net: store addresses in dict indexed by ipver
Looks like more and more tests want to iterate over IP version, run the same test over ipv4 and ipv6. The current naming of members in the env class makes it a bit awkward, we have separate members for ipv4 and ipv6 parameters. Store the parameters inside dicts, so that tests can easily index them with ip version. Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/drivers/net/hw/devmem.py')
-rwxr-xr-xtools/testing/selftests/drivers/net/hw/devmem.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/drivers/net/hw/devmem.py b/tools/testing/selftests/drivers/net/hw/devmem.py
index 1223f0f5c10c..3947e9157115 100755
--- a/tools/testing/selftests/drivers/net/hw/devmem.py
+++ b/tools/testing/selftests/drivers/net/hw/devmem.py
@@ -21,15 +21,15 @@ def require_devmem(cfg):
@ksft_disruptive
def check_rx(cfg) -> None:
- cfg.require_v6()
+ cfg.require_ipver("6")
require_devmem(cfg)
port = rand_port()
- listen_cmd = f"./ncdevmem -l -f {cfg.ifname} -s {cfg.v6} -p {port}"
+ listen_cmd = f"./ncdevmem -l -f {cfg.ifname} -s {cfg.addr_v['6']} -p {port}"
with bkg(listen_cmd) as socat:
wait_port_listen(port)
- cmd(f"echo -e \"hello\\nworld\"| socat -u - TCP6:[{cfg.v6}]:{port}", host=cfg.remote, shell=True)
+ cmd(f"echo -e \"hello\\nworld\"| socat -u - TCP6:[{cfg.addr_v['6']}]:{port}", host=cfg.remote, shell=True)
ksft_eq(socat.stdout.strip(), "hello\nworld")