netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>, netdev@vger.kernel.org
Cc: "Donald Hunter" <donald.hunter@gmail.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	"Jan Stancek" <jstancek@redhat.com>,
	"Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
	"Stanislav Fomichev" <sdf@fomichev.me>,
	"Ido Schimmel" <idosch@nvidia.com>,
	"Guillaume Nault" <gnault@redhat.com>,
	"Sabrina Dubroca" <sd@queasysnail.net>,
	"Petr Machata" <petrm@nvidia.com>
Subject: Re: [PATCHv4 net-next 3/3] tools: ynl: add YNL test framework
Date: Fri, 14 Nov 2025 19:00:02 +0100	[thread overview]
Message-ID: <9f8487ee-be04-4198-9fae-042facbf0883@kernel.org> (raw)
In-Reply-To: <20251114034651.22741-4-liuhangbin@gmail.com>

Hi Hangbin,

On 14/11/2025 04:46, Hangbin Liu wrote:
> Add a test framework for YAML Netlink (YNL) tools, covering both CLI and
> ethtool functionality. The framework includes:
> 
> 1) cli: family listing, netdev, ethtool, rt-* families, and nlctrl
>    operations
> 2) ethtool: device info, statistics, ring/coalesce/pause parameters, and
>    feature gettings
> 
> The current YNL syntax is a bit obscure, and end users may not always know
> how to use it. This test framework provides usage examples and also serves
> as a regression test to catch potential breakages caused by future changes.

Thank you for the new version!

I have two minor comments, up to you to fix that or not.

(...)

> diff --git a/tools/net/ynl/tests/test_ynl_cli.sh b/tools/net/ynl/tests/test_ynl_cli.sh
> new file mode 100755
> index 000000000000..f40eecbb9701
> --- /dev/null
> +++ b/tools/net/ynl/tests/test_ynl_cli.sh
> @@ -0,0 +1,309 @@
> +#!/bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Test YNL CLI functionality
> +
> +# Load KTAP test helpers
> +KSELFTEST_KTAP_HELPERS="$(dirname "$(realpath "$0")")/../../../testing/selftests/kselftest/ktap_helpers.sh"
> +# shellcheck disable=SC1090

nit: maybe you can use this instead?

# shellcheck source=../../../testing/selftests/kselftest/ktap_helpers.sh

(If not, it might be good to always document why something is disabled
by adding a comment on the same line or before.)

(Same for the other test.)

(...)
> +ktap_print_header
> +ktap_set_plan 9

I think you should print the plan after the setup, to avoid this in case
of errors during the setup:

  TAP version 13
  1..9
  1..0 # SKIP (...)
  <exit 4>


Note that it might be interesting to add a dedicated variable for the
tests counter that you increment after having declared each test, just
not to forget modifying the plan when a new test is added, e.g.

  TESTS_NO=0

  (...)

  cli_list_families() {
      (...)
  }
  TESTS_NO=$((TESTS_NO + 1))

  (...)

  # Run all tests
  ktap_set_plan "${TESTS_NO}"
  cli_list_families
  (...)

(Same for the other test.)

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


      parent reply	other threads:[~2025-11-14 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  3:46 [PATCHv4 net-next 0/3] Add YNL test framework and library improvements Hangbin Liu
2025-11-14  3:46 ` [PATCHv4 net-next 1/3] tools: ynl: Add MAC address parsing support Hangbin Liu
2025-11-14  3:46 ` [PATCHv4 net-next 2/3] netlink: specs: support ipv4-or-v6 for dual-stack fields Hangbin Liu
2025-11-14  3:46 ` [PATCHv4 net-next 3/3] tools: ynl: add YNL test framework Hangbin Liu
2025-11-14 11:46   ` Donald Hunter
2025-11-14 18:04     ` Matthieu Baerts
2025-11-16 10:38       ` Donald Hunter
2025-11-17  1:30         ` Hangbin Liu
2025-11-14 18:00   ` Matthieu Baerts [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f8487ee-be04-4198-9fae-042facbf0883@kernel.org \
    --to=matttbe@kernel.org \
    --cc=ast@fiberby.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=gnault@redhat.com \
    --cc=horms@kernel.org \
    --cc=idosch@nvidia.com \
    --cc=jstancek@redhat.com \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=sd@queasysnail.net \
    --cc=sdf@fomichev.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).