aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/lib/py/nsim.py
diff options
context:
space:
mode:
authorDavid Wei <dw@davidwei.uk>2024-05-07 09:32:28 -0700
committerJakub Kicinski <kuba@kernel.org>2024-05-08 18:59:47 -0700
commit1cf2704242180351d156fb48c334b319ae6b0759 (patch)
tree4b170d7487ac21ac5ae53a7308a678478b99e6a4 /tools/testing/selftests/net/lib/py/nsim.py
parent3762ec05a9fbda16aaaa2568df679ab8ad13f38d (diff)
net: selftest: add test for netdev netlink queue-get API
Add a selftest for netdev generic netlink. For now there is only a single test that exercises the `queue-get` API. The test works with netdevsim by default or with a real device by setting NETIF. Add a timeout param to cmd() since ethtool -L can take a long time on real devices. Signed-off-by: David Wei <dw@davidwei.uk> Link: https://lore.kernel.org/r/20240507163228.2066817-3-dw@davidwei.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/nsim.py')
-rw-r--r--tools/testing/selftests/net/lib/py/nsim.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/lib/py/nsim.py b/tools/testing/selftests/net/lib/py/nsim.py
index 06896cdf7c18..f571a8b3139b 100644
--- a/tools/testing/selftests/net/lib/py/nsim.py
+++ b/tools/testing/selftests/net/lib/py/nsim.py
@@ -49,7 +49,7 @@ class NetdevSimDev:
with open(fullpath, "w") as f:
f.write(val)
- def __init__(self, port_count=1, ns=None):
+ def __init__(self, port_count=1, queue_count=1, ns=None):
# nsim will spawn in init_net, we'll set to actual ns once we switch it there
self.ns = None
@@ -59,7 +59,7 @@ class NetdevSimDev:
addr = random.randrange(1 << 15)
while True:
try:
- self.ctrl_write("new_device", "%u %u" % (addr, port_count))
+ self.ctrl_write("new_device", "%u %u %u" % (addr, port_count, queue_count))
except OSError as e:
if e.errno == errno.ENOSPC:
addr = random.randrange(1 << 15)