[Devel] [PATCH vz10 2/4] selftests: net: py: add the missing ksft_is() and ksft_not_in() helpers

Eva Kurchatova eva.kurchatova at virtuozzo.com
Tue Sep 1 01:50:52 MSK 2026


rss_api.py and rss_flow_label.py call ksft_is() and ksft_not_in(), and
net/lib/py/__init__.py exports both, but ksft.py never defined them, so
importing the library fails and every test of the group goes down with
it:

  ImportError: cannot import name 'ksft_is' from 'net.lib.py'

The tests and the export came in with the RHEL10 import, commit
9f055df11343 ("rh10: import RHEL10 kernel-6.12.0-211.16.1.el10"), the
helpers did not. Take them from the commits that added them upstream,
commit 31eae6d99587 ("selftests: drv-net: test drivers sleeping in
ndo_get_stats64") for ksft_is() and commit 4fde8398462f ("selftests:
drv-net: improve the use of ksft helpers in XSK queue test") for
ksft_not_in(). The tests those commits add are left out.

https://virtuozzo.atlassian.net/browse/VSTOR-139651
Feature: fix vz selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
 tools/testing/selftests/net/lib/py/ksft.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/testing/selftests/net/lib/py/ksft.py b/tools/testing/selftests/net/lib/py/ksft.py
index 7b50111340bb..61287c203b6e 100644
--- a/tools/testing/selftests/net/lib/py/ksft.py
+++ b/tools/testing/selftests/net/lib/py/ksft.py
@@ -76,6 +76,16 @@ def ksft_in(a, b, comment=""):
         _fail("Check failed", a, "not in", b, comment)
 
 
+def ksft_not_in(a, b, comment=""):
+    if a in b:
+        _fail("Check failed", a, "in", b, comment)
+
+
+def ksft_is(a, b, comment=""):
+    if a is not b:
+        _fail("Check failed", a, "is not", b, comment)
+
+
 def ksft_ge(a, b, comment=""):
     if a < b:
         _fail("Check failed", a, "<", b, comment)
-- 
2.55.0



More information about the Devel mailing list