selftests: net: add scaffolding for Netlink tests in Python
authorJakub Kicinski <kuba@kernel.org>
Fri, 5 Apr 2024 02:45:22 +0000 (19:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Apr 2024 10:40:41 +0000 (11:40 +0100)
commitb86761ff6374813cdf64ffd6b95ddd1813c435d8
tree5654585e5afc663cc5fa8b991f62cb102e186ee4
parentd7d6e47016bc536b3443fc16ee694743bfb109c7
selftests: net: add scaffolding for Netlink tests in Python

Add glue code for accessing the YNL library which lives under
tools/net and YAML spec files from under Documentation/.
Automatically figure out if tests are run in tree or not.
Since we'll want to use this library both from net and
drivers/net test targets make the library a target as well,
and automatically include it when net or drivers/net are
included. Making net/lib a target ensures that we end up
with only one copy of it, and saves us some path guessing.

Add a tiny bit of formatting support to be able to output KTAP
from the start.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/Makefile
tools/testing/selftests/net/lib/Makefile [new file with mode: 0644]
tools/testing/selftests/net/lib/py/__init__.py [new file with mode: 0644]
tools/testing/selftests/net/lib/py/consts.py [new file with mode: 0644]
tools/testing/selftests/net/lib/py/ksft.py [new file with mode: 0644]
tools/testing/selftests/net/lib/py/utils.py [new file with mode: 0644]
tools/testing/selftests/net/lib/py/ynl.py [new file with mode: 0644]