diff options
| author | Jakub Kicinski <[email protected]> | 2025-03-27 22:23:13 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-03-31 23:44:25 +0000 |
| commit | e514d77334a63f1dcb9a3b47d5aee8f51d66cb1d (patch) | |
| tree | 4cba27bfdfddac445d386ca459df3c039788252b /tools/testing/selftests/drivers/net/queues.py | |
| parent | net: lapbether: use netdev_lockdep_set_classes() helper (diff) | |
| download | kernel-e514d77334a63f1dcb9a3b47d5aee8f51d66cb1d.tar.gz kernel-e514d77334a63f1dcb9a3b47d5aee8f51d66cb1d.zip | |
selftests: drv-net: replace the rpath helper with Path objects
The single letter + "path" helpers do not have many fans (see Link).
Use a Path object with a better name. test_dir is the replacement
for rpath(), net_lib_dir is a new path of the $ksft/net/lib directory.
The Path() class overloads the "/" operator and can be cast to string
automatically, so to get a path to a file tests can do:
path = env.test_dir / "binary"
Link: https://lore.kernel.org/CA+FuTSemTNVZ5MxXkq8T9P=DYm=nSXcJnL7CJBPZNAT_9UFisQ@mail.gmail.com
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/queues.py')
| -rwxr-xr-x | tools/testing/selftests/drivers/net/queues.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/drivers/net/queues.py b/tools/testing/selftests/drivers/net/queues.py index cae923f84f69..06abd3f233e1 100755 --- a/tools/testing/selftests/drivers/net/queues.py +++ b/tools/testing/selftests/drivers/net/queues.py @@ -26,13 +26,13 @@ def nl_get_queues(cfg, nl, qtype='rx'): def check_xsk(cfg, nl, xdp_queue_id=0) -> None: # Probe for support - xdp = cmd(cfg.rpath("xdp_helper") + ' - -', fail=False) + xdp = cmd(f'{cfg.test_dir / "xdp_helper"} - -', fail=False) if xdp.ret == 255: raise KsftSkipEx('AF_XDP unsupported') elif xdp.ret > 0: raise KsftFailEx('unable to create AF_XDP socket') - with bkg(f'{cfg.rpath("xdp_helper")} {cfg.ifindex} {xdp_queue_id}', + with bkg(f'{cfg.test_dir / "xdp_helper"} {cfg.ifindex} {xdp_queue_id}', ksft_wait=3): rx = tx = False |
