[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240416173159.38a7818e@kernel.org>
Date: Tue, 16 Apr 2024 17:31:59 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: David Wei <dw@...idwei.uk>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH v1 2/2] net: selftest: add test for netdev netlink
queue-get API
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
Powered by blists - more mailing lists