diff mbox series

[v2] selftests: net/rds: add module not found

Message ID 20241010194421.48198-1-alessandro.zanni87@gmail.com (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series [v2] selftests: net/rds: add module not found | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 5 this patch: 5
netdev/build_tools success Errors and warnings before: 0 (+1) this patch: 0 (+1)
netdev/cc_maintainers warning 1 maintainers not CCed: rds-devel@oss.oracle.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest warning net-next-2024-10-11--00-00 (tests: 777)

Commit Message

Alessandro Zanni Oct. 10, 2024, 7:44 p.m. UTC
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.

Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
---

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(-)

Comments

Allison Henderson Oct. 11, 2024, 5:58 a.m. UTC | #1
On Thu, 2024-10-10 at 21:44 +0200, Alessandro Zanni 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.
> 
> Signed-off-by: Alessandro Zanni <alessandro.zanni87@gmail.com>
I think this one looks ok.  Thanks Alessandro!

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
> 
> 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(-)
> 
> diff --git a/tools/testing/selftests/net/rds/test.py
> b/tools/testing/selftests/net/rds/test.py
> index e6bb109bcead..4a7178d11193 100755
> --- a/tools/testing/selftests/net/rds/test.py
> +++ b/tools/testing/selftests/net/rds/test.py
> @@ -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
diff mbox series

Patch

diff --git a/tools/testing/selftests/net/rds/test.py b/tools/testing/selftests/net/rds/test.py
index e6bb109bcead..4a7178d11193 100755
--- a/tools/testing/selftests/net/rds/test.py
+++ b/tools/testing/selftests/net/rds/test.py
@@ -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