From: David Ahern <dsahern@gmail.com>
To: Stefano Brivio <sbrivio@redhat.com>, David Ahern <dsahern@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next] selftests: Add debugging options to pmtu.sh
Date: Thu, 4 Apr 2019 09:24:21 -0600 [thread overview]
Message-ID: <bd15c09b-b0bf-96ba-093f-526d615dad3e@gmail.com> (raw)
In-Reply-To: <20190404141655.1cc171ad@redhat.com>
On 4/4/19 6:16 AM, Stefano Brivio wrote:
>> diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh
>> index 912b2dc50be3..28e8c97b5c9e 100755
>> --- a/tools/testing/selftests/net/pmtu.sh
>> +++ b/tools/testing/selftests/net/pmtu.sh
>> @@ -116,6 +116,9 @@
>> # Kselftest framework requirement - SKIP code is 4.
>> ksft_skip=4
>>
>> +PAUSE_ON_FAIL=no
>> +VERBOSE=0
>
> For consistency, I'd also rename 'tracing' below to TRACING and assign
> it here.
ok.
>
>> # Some systems don't have a ping6 binary anymore
>> which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
>>
>> @@ -222,6 +225,26 @@ err_flush() {
>> err_buf=
>> }
>>
>> +run_cmd() {
>> + local cmd="$*"
>> + local out
>> + local stderr="2>/dev/null"
>
> 'local' is not POSIX, and I think it actually breaks (at least) on
> ksh93 (maybe not a big deal, but I kept everything else POSIX, so I
> wouldn't break it just for this).
ok. I did not realize this one is expected to be posix compliant. I have
fib_test.sh using /bin/bash
>
> Besides, for 'ping' commands, it's stdout that needs to be suppressed
> (we can just suppress both stdout and stderr if not in verbose mode).
sure
>
>> + if [ "$VERBOSE" = "1" ]; then
>> + printf " COMMAND: $cmd\n"
>> + stderr=
>> + fi
>> +
>> + out=$(eval $cmd $stderr)
>
> I think this needs quoting. Is eval really needed, by the way?
old habits. Works fine with bash; not sure about others.
prev parent reply other threads:[~2019-04-04 15:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-04 1:18 [PATCH net-next] selftests: Add debugging options to pmtu.sh David Ahern
2019-04-04 12:16 ` Stefano Brivio
2019-04-04 15:24 ` David Ahern [this message]
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=bd15c09b-b0bf-96ba-093f-526d615dad3e@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.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).