netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@fomichev.me>
To: Ales Nezbeda <anezbeda@redhat.com>
Cc: netdev@vger.kernel.org, sd@queasysnail.net, davem@davemloft.net
Subject: Re: [PATCH net] selftests: rtnetlink: add 'ethtool' as a dependency
Date: Tue, 3 Sep 2024 13:28:11 -0700	[thread overview]
Message-ID: <ZtdxW9v8oWt-Ows8@mini-arch> (raw)
In-Reply-To: <20240903151524.586614-1-anezbeda@redhat.com>

On 09/03, Ales Nezbeda wrote:
> Introduction of `kci_test_macsec_offload()` in `rtnetlink.sh` created
> a new dependency `ethtool` for the test suite. This dependency is not
> reflected in checks that run before all the tests, so if the `ethtool`
> is not present, all tests will start, but `macsec_offload` test will
> fail with a misleading message. Message would say that MACsec offload is
> not supported, yet it never actually managed to check this, since it
> needs the `ethtool` to do so.
> 
> Fixes: 3b5222e2ac57 ("selftests: rtnetlink: add MACsec offload tests")
> Signed-off-by: Ales Nezbeda <anezbeda@redhat.com>
> ---
>  tools/testing/selftests/net/rtnetlink.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tools/testing/selftests/net/rtnetlink.sh b/tools/testing/selftests/net/rtnetlink.sh
> index bdf6f10d0558..fdd116458222 100755
> --- a/tools/testing/selftests/net/rtnetlink.sh
> +++ b/tools/testing/selftests/net/rtnetlink.sh
> @@ -1306,6 +1306,7 @@ if [ "$(id -u)" -ne 0 ];then
>  	exit $ksft_skip
>  fi
>  
> +#check for dependencies
>  for x in ip tc;do
>  	$x -Version 2>/dev/null >/dev/null
>  	if [ $? -ne 0 ];then
> @@ -1313,6 +1314,11 @@ for x in ip tc;do
>  		exit $ksft_skip
>  	fi
>  done
> +ethtool --version 2>/dev/null >/dev/null
> +if [ $? -ne 0 ];then
> +	end_test "SKIP: Could not run test without the ethtool tool"
> +	exit $ksft_skip
> +fi

Can we use a 'require_command ethtool' (lib.sh helper) instead?

  reply	other threads:[~2024-09-03 20:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 15:15 [PATCH net] selftests: rtnetlink: add 'ethtool' as a dependency Ales Nezbeda
2024-09-03 20:28 ` Stanislav Fomichev [this message]
2024-09-08 23:09   ` Ales Nezbeda

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=ZtdxW9v8oWt-Ows8@mini-arch \
    --to=sdf@fomichev.me \
    --cc=anezbeda@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sd@queasysnail.net \
    /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).