Skip to contentSkip to conversation

selftests: net/rds: add module not found

PATCH Applied Alessandro Zanni 3 participants 3 messages Oct 10, 2024 – Oct 11, 2024

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests: net/rds: add module not found

This fix solves this error, when calling kselftest with targets "net/rds":

The error was found by running tests manually with the command:
make kselftest TARGETS="net/rds"

The patch also specifies to import ip() function from the utils module.

---

Notes:
v2:
modified the way the parent path is added
added test to reproduce the error

 tools/testing/selftests/net/rds/test.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/net/rds/test.py +4 -1
index e6bb109bcead..4a7178d11193 100755
@@ -14,8 +14,11 @@ import sys
 import atexit
 from pwd import getpwuid
 from os import stat
-from lib.py import ip
 
+# Allow utils module to be imported from different directory
+this_dir = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(this_dir, "../"))
+from lib.py.utils import ip
 
 libc = ctypes.cdll.LoadLibrary('libc.so.6')
 setns = libc.setns
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Alessandro Zanni

This fix solves this error, when calling kselftest with targets "net/rds":

The error was found by running tests manually with the command:
make kselftest TARGETS="net/rds"

The patch also specifies to import ip() function from the utils module.

I think this one looks ok. Thanks Alessandro!

Quoted 28 lines

---

Notes:
    v2:
      modified the way the parent path is added
      added test to reproduce the error

 tools/testing/selftests/net/rds/test.py | 5 ++++-

 1 file changed, 4 insertions(+), 1 deletion(-)
tools/testing/selftests/net/rds/test.py +0 -0
index e6bb109bcead..4a7178d11193 100755
@@ -14,8 +14,11 @@ import sys

 import atexit
 from pwd import getpwuid
 from os import stat
-from lib.py import ip

tools/testing/selftests/net/rds/test.py +4 -0
+# Allow utils module to be imported from different directory
+this_dir = os.path.dirname(os.path.realpath(__file__))
+sys.path.append(os.path.join(this_dir, "../"))
+from lib.py.utils import ip


 libc = ctypes.cdll.LoadLibrary('libc.so.6')
 setns = libc.setns

#2 lore raw
In reply to Alessandro Zanni
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 10 Oct 2024 21:44:17 +0200 you wrote:

This fix solves this error, when calling kselftest with targets "net/rds":

The error was found by running tests manually with the command:
make kselftest TARGETS="net/rds"

The patch also specifies to import ip() function from the utils module.

[...]

Here is the summary with links:
- [v2] selftests: net/rds: add module not found

    https://git.kernel.org/netdev/net/c/6ea8a1c28fd3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html