All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Donald Hunter <donald.hunter@gmail.com>
Cc: "Matthieu Baerts" <matttbe@kernel.org>,
	netdev@vger.kernel.org, "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: Mon, 17 Nov 2025 01:30:49 +0000	[thread overview]
Message-ID: <aRp6yb2W10aPZlEG@fedora> (raw)
In-Reply-To: <m2cy5inty1.fsf@gmail.com>

On Sun, Nov 16, 2025 at 10:38:30AM +0000, Donald Hunter wrote:
> Matthieu Baerts <matttbe@kernel.org> writes:
> 
> > Hi Donald,
> >
> > On 14/11/2025 12:46, Donald Hunter wrote:
> >> Hangbin Liu <liuhangbin@gmail.com> writes:
> >>>
> >>> +cleanup() {
> >>> +	if [[ -n "$testns" ]]; then
> >>> +		ip netns exec "$testns" bash -c "echo $NSIM_ID > /sys/bus/netdevsim/del_device" 2>/dev/null || true
> >>> +		ip netns del "$testns" 2>/dev/null || true
> >>> +	fi
> >>> +}
> >>> +
> >>> +# Check if ynl command is available
> >>> +if ! command -v $ynl &>/dev/null && [[ ! -x $ynl ]]; then
> >>> +	ktap_skip_all "ynl command not found: $ynl"
> >>> +	exit "$KSFT_SKIP"
> >>> +fi
> >>> +
> >>> +trap cleanup EXIT
> >>> +
> >>> +ktap_print_header
> >>> +ktap_set_plan 9>> +setup
> >>> +
> >>> +# Run all tests
> >>> +cli_list_families
> >>> +cli_netdev_ops
> >>> +cli_ethtool_ops
> >>> +cli_rt_route_ops
> >>> +cli_rt_addr_ops
> >>> +cli_rt_link_ops
> >>> +cli_rt_neigh_ops
> >>> +cli_rt_rule_ops
> >>> +cli_nlctrl_ops
> >>> +
> >>> +ktap_finished
> >> 
> >> minor nit: ktap_finished should probably be in the 'cleanup' trap handler
> >
> > @Donald: I don't think 'ktap_finished' should be called there: in case
> > of errors with an early exit during the setup phase, the two scripts
> > will call 'ktap_skip_all', then 'exit "$KSFT_SKIP"'. If 'ktap_finished'
> > is called in the 'cleanup' trap, it will print a total with everything
> > set to 0 and call 'exit' again with other values (and no effects). So I
> > think it is not supposed to be called from the exit trap.
> 
> Okay, fair. I thought the goal was to always output totals. Looking at
> ktap_helpers.sh I see that it can't output a meaningful skip count for
> the skip_call case.

Definitely, I will add this to my todo list and see if I could fix the helper.

Thanks
Hangbin

  reply	other threads:[~2025-11-17  1:30 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 [this message]
2025-11-14 18:00   ` Matthieu Baerts

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=aRp6yb2W10aPZlEG@fedora \
    --to=liuhangbin@gmail.com \
    --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=matttbe@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.