Re: [PATCH net-next v2 6/7] selftests: drv-net: improve the use of ksft helpers in XSK queue test

Kurt Kanzenbach
2025-02-20T07:31:43Z

[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]

On Wed Feb 19 2025, Jakub Kicinski wrote:
> Avoid exceptions when xsk attr is not present, and add a proper ksft
> helper for "not in" condition.
>
> Acked-by: Stanislav Fomichev <sdf@fomichev.me>
> Reviewed-by: Joe Damato <jdamato@fastly.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> tools/testing/selftests/drivers/net/queues.py | 9 +++++----
> tools/testing/selftests/net/lib/py/ksft.py | 5 +++++
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/tools/testing/selftests/drivers/net/queues.py b/tools/testing/selftests/drivers/net/queues.py
> index 7af2adb61c25..a49f1a146e28 100755
> --- a/tools/testing/selftests/drivers/net/queues.py
> +++ b/tools/testing/selftests/drivers/net/queues.py
> @@ -2,7 +2,7 @@
> # SPDX-License-Identifier: GPL-2.0
>
> from lib.py import ksft_disruptive, ksft_exit, ksft_run
> -from lib.py import ksft_eq, ksft_raises, KsftSkipEx, KsftFailEx
> +from lib.py import ksft_eq, ksft_not_in, ksft_raises, KsftSkipEx, KsftFailEx
> from lib.py import EthtoolFamily, NetdevFamily, NlError
> from lib.py import NetDrvEnv
> from lib.py import bkg, cmd, defer, ip
> @@ -47,10 +47,11 @@ import struct
> if q['type'] == 'tx':
> tx = True
>
> - ksft_eq(q['xsk'], {})
> + ksft_eq(q.get('xsk', None), {},
> + comment="xsk attr on queue we configured")

Thanks. That's much better than getting exceptions in the case where no
xsk attribute is available:

Tested-by: Kurt Kanzenbach <kurt@linutronix.de>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]