]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests: drv-net: replace the rpath helper with Path objects
authorJakub Kicinski <kuba@kernel.org>
Thu, 27 Mar 2025 22:23:13 +0000 (15:23 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 31 Mar 2025 23:44:25 +0000 (16:44 -0700)
commite514d77334a63f1dcb9a3b47d5aee8f51d66cb1d
tree4cba27bfdfddac445d386ca459df3c039788252b
parent7220e8f4d4eec0b2f682eef45e2d36c092738413
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 <willemb@google.com>
Link: https://patch.msgid.link/20250327222315.1098596-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hds.py
tools/testing/selftests/drivers/net/hw/csum.py
tools/testing/selftests/drivers/net/hw/irq.py
tools/testing/selftests/drivers/net/lib/py/env.py
tools/testing/selftests/drivers/net/queues.py