[Devel] [PATCH vz10 2/4] selftests: net: py: add the missing ksft_is() and ksft_not_in() helpers
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Sep 24 16:27:52 MSK 2026
Committed to branch-rh10-6.12.0-211.52.1.22.x.vz10-ovz, will be released in rh10-6.12.0-211.52.1.22.3.vz10
5cf658d7912e
selftests: net: py: add the missing ksft_is() and ksft_not_in() helpers
rss_api.py and rss_flow_label.py call ksft_is() and ksft_not_in(), and
drivers/net/lib/py/__init__.py and drivers/net/hw/lib/py/__init__.py
import both by name from net.lib.py, 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 imports 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 selftests
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
Link: http://lore.virtuozzo.com/20260831225137.1642608-2-eva.kurchatova@virtuozzo.com
--
Best regards,
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
On 9/1/26 00:50, Eva Kurchatova wrote:
> 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)
More information about the Devel
mailing list