Subject: Re: [PATCH 1/5] tools: ynl: move python code to separate sub-directory

From: Stanislav Fomichev <[email-masked]>
Date: Tue, 3 Dec 2024 08:52:49 -0800

On 12/03, Jan Stancek wrote:
> Move python code to a separate directory so it can be
> packaged as a python module.

There is a bunch of selftests that depend on this location:

make -C tools/testing/selftests TARGETS="drivers/net" TEST_PROGS=ping.py TTEST_GEN_PROGS="" run_tests
make: Entering directory '/home/virtme/testing-18/tools/testing/selftests'
make[1]: Entering directory '/home/virtme/testing-18/tools/testing/selftests/drivers/net'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/virtme/testing-18/tools/testing/selftests/drivers/net'
make[1]: Entering directory '/home/virtme/testing-18/tools/testing/selftests/drivers/net'
TAP version 13
1..1
# overriding timeout to 90
# selftests: drivers/net: ping.py
# Traceback (most recent call last):
#   File "/home/virtme/testing-18/tools/testing/selftests/drivers/net/./ping.py", line 4, in <module>
#     from lib.py import ksft_run, ksft_exit
#   File "/home/virtme/testing-18/tools/testing/selftests/drivers/net/lib/py/__init__.py", line 10, in <module>
#     from net.lib.py import *
#   File "/home/virtme/testing-18/tools/testing/selftests/net/lib/py/__init__.py", line 8, in <module>
#     from .ynl import NlError, YnlFamily, EthtoolFamily, NetdevFamily, RtnlFamily
#   File "/home/virtme/testing-18/tools/testing/selftests/net/lib/py/ynl.py", line 23, in <module>
#     from net.ynl.lib import YnlFamily, NlError
# ImportError: cannot import name 'YnlFamily' from 'net.ynl.lib' (unknown location)
not ok 1 selftests: drivers/net: ping.py # exit=1
make[1]: Leaving directory '/home/virtme/testing-18/tools/testing/selftests/drivers/net'
make: Leaving directory '/home/virtme/testing-18/tools/testing/selftests'
xx__-> echo $?
0
xx__-> echo scan > /sys/kernel/debug/kmemleak && cat /sys/kernel/debug/kmemleak
xx__-> 

---
pw-bot: cr