From: Jakub Kicinski <kuba@kernel.org>
To: Yuyang Huang <yuyanghuang@google.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Shuah Khan" <shuah@kernel.org>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Maciej Żenczykowski" <maze@google.com>,
"Lorenzo Colitti" <lorenzo@google.com>
Subject: Re: [PATCH net-next, v3] selftest: Add selftest for multicast address notifications
Date: Fri, 13 Jun 2025 17:29:41 -0700 [thread overview]
Message-ID: <20250613172941.6c454992@kernel.org> (raw)
In-Reply-To: <20250612020514.2542424-1-yuyanghuang@google.com>
On Thu, 12 Jun 2025 11:05:14 +0900 Yuyang Huang wrote:
> +VERBOSE=0
> +PAUSE=no
> +PAUSE_ON_FAIL=no
> +
> +source lib.sh
> +
> +# set global exit status, but never reset nonzero one.
> +check_err()
> +{
> + if [ $ret -eq 0 ]; then
> + ret=$1
> + fi
> + [ -n "$2" ] && echo "$2"
> +}
> +
> +run_cmd_common()
> +{
> + local cmd="$*"
> + local out
> + if [ "$VERBOSE" = "1" ]; then
> + echo "COMMAND: ${cmd}"
> + fi
> + out=$($cmd 2>&1)
> + rc=$?
> + if [ "$VERBOSE" = "1" -a -n "$out" ]; then
> + echo " $out"
> + fi
> + return $rc
> +}
> +
> +run_cmd() {
> + run_cmd_common "$@"
> + rc=$?
> + check_err $rc
> + return $rc
> +}
> +
> +end_test()
> +{
> + echo "$*"
> + [ "${VERBOSE}" = "1" ] && echo
> +
> + if [[ $ret -ne 0 ]] && [[ "${PAUSE_ON_FAIL}" = "yes" ]]; then
> + echo "Hit enter to continue"
> + read a
> + fi;
> +
> + if [ "${PAUSE}" = "yes" ]; then
> + echo "Hit enter to continue"
> + read a
> + fi
> +
> +}
Perhaps move these to lib.sh as a separate commit?
They seem generic.
Please fix the shellcheck warnings. The "info"-level messages
are up you, SC2317 can be ignored.
--
pw-bot: cr
next prev parent reply other threads:[~2025-06-14 0:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-12 2:05 [PATCH net-next, v3] selftest: Add selftest for multicast address notifications Yuyang Huang
2025-06-14 0:29 ` Jakub Kicinski [this message]
2025-06-14 3:23 ` Yuyang Huang
-- strict thread matches above, loose matches on Subject: below --
2025-06-18 10:32 Yuyang Huang
2025-06-18 10:33 ` Yuyang Huang
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=20250613172941.6c454992@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lorenzo@google.com \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=yuyanghuang@google.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).