diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2024-04-04 19:45:22 -0700 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2024-04-08 11:40:41 +0100 |
| commit | b86761ff6374813cdf64ffd6b95ddd1813c435d8 (patch) | |
| tree | 5654585e5afc663cc5fa8b991f62cb102e186ee4 /tools/testing/selftests/net/lib/py/consts.py | |
| parent | d7d6e47016bc536b3443fc16ee694743bfb109c7 (diff) | |
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>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/consts.py')
| -rw-r--r-- | tools/testing/selftests/net/lib/py/consts.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/lib/py/consts.py b/tools/testing/selftests/net/lib/py/consts.py new file mode 100644 index 000000000000..f518ce79d82c --- /dev/null +++ b/tools/testing/selftests/net/lib/py/consts.py @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0 + +import sys +from pathlib import Path + +KSFT_DIR = (Path(__file__).parent / "../../..").resolve() +KSRC = (Path(__file__).parent / "../../../../../..").resolve() + +KSFT_MAIN_NAME = Path(sys.argv[0]).with_suffix("").name |
