From: Jakub Kicinski <kuba@kernel.org>
To: Alessandro Zanni <alessandro.zanni87@gmail.com>
Cc: allison.henderson@oracle.com, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, shuah@kernel.org,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, anupnewsmail@gmail.com
Subject: Re: [PATCH] selftests: net: rds: fix module not found
Date: Wed, 9 Oct 2024 19:40:31 -0700 [thread overview]
Message-ID: <20241009194031.269a1251@kernel.org> (raw)
In-Reply-To: <20241008082259.243476-1-alessandro.zanni87@gmail.com>
On Tue, 8 Oct 2024 10:22:53 +0200 Alessandro Zanni wrote:
> This fix solves this error, when calling kselftest with targets "net/rds":
>
> selftests: net/rds: test.py
> Traceback (most recent call last):
> File "tools/testing/selftests/net/rds/./test.py", line 17, in <module>
> from lib.py import ip
> ModuleNotFoundError: No module named 'lib'
>
> Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
> ---
> tools/testing/selftests/net/rds/test.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
> index e6bb109bcead..112a8059c030 100755
> --- a/tools/testing/selftests/net/rds/test.py
> +++ b/tools/testing/selftests/net/rds/test.py
> @@ -14,8 +14,9 @@ import sys
> import atexit
> from pwd import getpwuid
> from os import stat
> -from lib.py import ip
>
> +sys.path.append("..")
> +from lib.py.utils import ip
>
> libc = ctypes.cdll.LoadLibrary('libc.so.6')
> setns = libc.setns
Does this work regardless of where we try to run the script from?
In other cross-imports we try to build the path based on __file__,
see: tools/testing/selftests/drivers/net/lib/py/__init__.py
Would be good to keep consistency.
--
pw-bot: cr
next prev parent reply other threads:[~2024-10-10 2:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-08 8:22 [PATCH] selftests: net: rds: fix module not found Alessandro Zanni
2024-10-10 2:40 ` Jakub Kicinski [this message]
2024-10-10 19:11 ` Alessandro Zanni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241009194031.269a1251@kernel.org \
--to=kuba@kernel.org \
--cc=alessandro.zanni87@gmail.com \
--cc=allison.henderson@oracle.com \
--cc=anupnewsmail@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.