[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3f3ecb14-88ce-4de3-91b7-d1b84867c182@kernel.org>
Date: Fri, 14 Nov 2025 19:04:04 +0100
From: Matthieu Baerts <matttbe@...nel.org>
To: Donald Hunter <donald.hunter@...il.com>,
Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>,
Jan Stancek <jstancek@...hat.com>, Asbjørn Sloth Tønnesen <ast@...erby.net>, Stanislav Fomichev <sdf@...ichev.me>,
Ido Schimmel <idosch@...dia.com>, Guillaume Nault <gnault@...hat.com>,
Sabrina Dubroca <sd@...asysnail.net>, Petr Machata <petrm@...dia.com>
Subject: Re: [PATCHv4 net-next 3/3] tools: ynl: add YNL test framework
Hi Donald,
On 14/11/2025 12:46, Donald Hunter wrote:
> Hangbin Liu <liuhangbin@...il.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.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
Powered by blists - more mailing lists