Subject: Re: [PATCH v1 2/2] net: selftest: add test for netdev netlink queue-get API

From: Jakub Kicinski <[email-masked]>
Date: Tue, 16 Apr 2024 17:31:59 -0700

On Mon, 15 Apr 2024 22:15:27 -0700 David Wei wrote:
> Add a selftest for Netdev Netlink queue-get API. The ground truth is
> determined by sysfs.
> 
> The test works with netdevsim by default or with a real device by
> setting NETIF.

Nice!

> +    def dev_up(self):
> +        ip(f"link set dev {self.dev['ifname']} up")
> +
> +    def dev_down(self):
> +        ip(f"link set dev {self.dev['ifname']} down")

Let's ifup the device as part of env setup instead?

> diff --git a/tools/testing/selftests/drivers/net/queues.py b/tools/testing/selftests/drivers/net/queues.py
> new file mode 100755
> index 000000000000..de2820f2759a
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/queues.py
> @@ -0,0 +1,67 @@
> +#!/usr/bin/env python3
> +# SPDX-License-Identifier: GPL-2.0
> +
> +from lib.py import ksft_run, ksft_in, ksft_true, ksft_eq, KsftSkipEx, KsftXfailEx
> +from lib.py import NetdevFamily, NlError
> +from lib.py import NetDrvEnv
> +from lib.py import cmd
> +import glob
> +
> +netnl = NetdevFamily()

Would it be cleaner to pass this as an argument to the tests instead of
using a global?
-- 
pw-bot: cr