From: Petr Machata <petrm@nvidia.com>
To: Po-Hsu Lin <po-hsu.lin@canonical.com>
Cc: <linux-kselftest@vger.kernel.org>, <netdev@vger.kernel.org>,
<bpf@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<shuah@kernel.org>, <skhan@linuxfoundation.org>, <ast@kernel.org>,
<daniel@iogearbox.net>, <andrii@kernel.org>, <kafai@fb.com>,
<songliubraving@fb.com>, <yhs@fb.com>, <john.fastabend@gmail.com>,
<kpsingh@kernel.org>, <davem@davemloft.net>, <kuba@kernel.org>,
<hawk@kernel.org>, <nikolay@nvidia.com>, <gnault@redhat.com>,
<vladimir.oltean@nxp.com>, <idosch@nvidia.com>,
<baowen.zheng@corigine.com>, <danieller@nvidia.com>,
<petrm@nvidia.com>
Subject: Re: [PATCH] selftests: Use kselftest skip code for skipped tests
Date: Tue, 25 May 2021 12:20:04 +0200 [thread overview]
Message-ID: <87lf83cdyj.fsf@nvidia.com> (raw)
In-Reply-To: <20210525061724.13526-1-po-hsu.lin@canonical.com>
Po-Hsu Lin <po-hsu.lin@canonical.com> writes:
> diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
> index 42e28c9..eed9f08 100644
> --- a/tools/testing/selftests/net/forwarding/lib.sh
> +++ b/tools/testing/selftests/net/forwarding/lib.sh
> @@ -4,6 +4,9 @@
> ##############################################################################
> # Defines
>
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> # Can be overridden by the configuration file.
> PING=${PING:=ping}
> PING6=${PING6:=ping6}
> @@ -121,7 +124,7 @@ check_ethtool_lanes_support()
>
> if [[ "$(id -u)" -ne 0 ]]; then
> echo "SKIP: need root privileges"
> - exit 0
> + exit $ksft_skip
> fi
>
> if [[ "$CHECK_TC" = "yes" ]]; then
> diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh
> index 76efb1f..bb7dc6d 100755
> --- a/tools/testing/selftests/net/forwarding/router_mpath_nh.sh
> +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh.sh
> @@ -1,6 +1,9 @@
> #!/bin/bash
> # SPDX-License-Identifier: GPL-2.0
>
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> ALL_TESTS="
> ping_ipv4
> ping_ipv6
> @@ -411,7 +414,7 @@ ping_ipv6()
> ip nexthop ls >/dev/null 2>&1
> if [ $? -ne 0 ]; then
> echo "Nexthop objects not supported; skipping tests"
> - exit 0
> + exit $ksft_skip
> fi
>
> trap cleanup EXIT
router_mpath_nh.sh sources lib.sh, which you changed above. This hunk
should not be necessary.
> diff --git a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh
> index 4898dd4..e7bb976 100755
> --- a/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh
> +++ b/tools/testing/selftests/net/forwarding/router_mpath_nh_res.sh
> @@ -1,6 +1,9 @@
> #!/bin/bash
> # SPDX-License-Identifier: GPL-2.0
>
> +# Kselftest framework requirement - SKIP code is 4.
> +ksft_skip=4
> +
> ALL_TESTS="
> ping_ipv4
> ping_ipv6
> @@ -386,7 +389,7 @@ ping_ipv6()
> ip nexthop ls >/dev/null 2>&1
> if [ $? -ne 0 ]; then
> echo "Nexthop objects not supported; skipping tests"
> - exit 0
> + exit $ksft_skip
> fi
>
> trap cleanup EXIT
Likewise.
Unless I'm missing some indirect dependency, no other selftests in your
patch have this problem.
next prev parent reply other threads:[~2021-05-25 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-25 6:17 [PATCH] selftests: Use kselftest skip code for skipped tests Po-Hsu Lin
2021-05-25 10:20 ` Petr Machata [this message]
2021-05-25 10:43 ` Po-Hsu Lin
2021-05-25 13:56 ` Willem de Bruijn
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=87lf83cdyj.fsf@nvidia.com \
--to=petrm@nvidia.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=baowen.zheng@corigine.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=danieller@nvidia.com \
--cc=davem@davemloft.net \
--cc=gnault@redhat.com \
--cc=hawk@kernel.org \
--cc=idosch@nvidia.com \
--cc=john.fastabend@gmail.com \
--cc=kafai@fb.com \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@nvidia.com \
--cc=po-hsu.lin@canonical.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=songliubraving@fb.com \
--cc=vladimir.oltean@nxp.com \
--cc=yhs@fb.com \
/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).