# 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
if q['type'] == 'tx':
tx = True
- ksft_eq(q['xsk'], {})
+ ksft_eq(q.get('xsk', None), {},
+ comment="xsk attr on queue we configured")
else:
- if 'xsk' in q:
- _fail("Check failed: xsk attribute set.")
+ ksft_not_in('xsk', q,
+ comment="xsk attr on queue we didn't configure")
ksft_eq(rx, True)
ksft_eq(tx, True)
_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)