netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Jeanson <mjeanson@efficios.com>
To: David Ahern <dsahern@gmail.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	David Ahern <dsahern@kernel.org>,
	linux-kernel@vger.kernel.org,
	"David S . Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/3] selftests: Add VRF icmp error route lookup test
Date: Fri, 14 Aug 2020 10:05:20 -0400 (EDT)	[thread overview]
Message-ID: <217122726.8258.1597413920624.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <49f26c7d-b8aa-57e7-02c6-424bec9c3845@gmail.com>

----- On 13 Aug, 2020, at 19:13, David Ahern dsahern@gmail.com wrote:

...

>> +ipv6_ping()
>> +{
>> +	log_section "IPv6: VRF ICMP error route lookup ping"
>> +
>> +	setup
>> +
>> +	# verify connectivity
>> +	if ! check_connectivity6; then
>> +		echo "Error: Basic connectivity is broken"
>> +		ret=1
>> +		return
>> +	fi
>> +
>> +	if [ "$VERBOSE" = "1" ]; then
>> +		echo "Command to check for ICMP ttl exceeded:"
>> +		run_cmd ip netns exec h1 "${ping6}" -t1 -c1 -W2 ${H2_N2_IP6}
>> +	fi
>> +
>> +	ip netns exec h1 "${ping6}" -t1 -c1 -W2 ${H2_N2_IP6} | grep -q "Time exceeded:
>> Hop limit"
> 
> run_cmd runs the command and if VERBOSE is set to 1 shows the command to
> the user. Something is off with this script and passing the -v arg -- I
> do not get a command list. This applies to the whole script.

Hum, I have no issues here with '-v', you get no output at all from run_cmd?

> 
> Since you need to check for output, I suggest modifying run_cmd to
> search the output for the given string.

I took this pattern of executing commands twice when running with verbose and
grepping the output from icmp_redirect.sh. I'll see if I can come up with
something fancier in run_cmd.


>> +	log_test $? 0 "Ping received ICMP ttl exceeded"
>> +}
>> +################################################################################
> 
> missing newline between '}' and '####'

Ack

...

>> +while getopts :46pvh o
>> +do
>> +	case $o in
>> +		4) TESTS=ipv4;;
>> +		6) TESTS=ipv6;;
>> +                p) PAUSE_ON_FAIL=yes;;
>> +                v) VERBOSE=1;;
>> +		h) usage; exit 0;;
>> +                *) usage; exit 1;;
> 
> indentation issues; not using tabs
> 

Ack

>> +	esac
>> +done
>> +
>> +#
>> +# show user test config
>> +#
>> +if [ -z "$TESTS" ]; then
>> +        TESTS="$TESTS_IPV4 $TESTS_IPV6"
>> +elif [ "$TESTS" = "ipv4" ]; then
>> +        TESTS="$TESTS_IPV4"
>> +elif [ "$TESTS" = "ipv6" ]; then
>> +        TESTS="$TESTS_IPV6"
>> +fi
>> +
>> +for t in $TESTS
>> +do
>> +	case $t in
>> +	ipv4_ping|ping)             ipv4_ping;;
>> +	ipv4_traceroute|traceroute) ipv4_traceroute;;
>> +
>> +	ipv6_ping|ping)             ipv6_ping;;
>> +	ipv6_traceroute|traceroute) ipv6_traceroute;;
>> +
>> +	# setup namespaces and config, but do not run any tests
>> +	setup)                      setup; exit 0;;
> 
> you don't allow '-t setup' so you can remove this part

I'l add the missing '-t' option to getopts.

> 
>> +
>> +	help)                       echo "Test names: $TESTS"; exit 0;;
>> +	esac
>> +done
>> +
>> +cleanup
>> +
>> +printf "\nTests passed: %3d\n" ${nsuccess}
>> +printf "Tests failed: %3d\n"   ${nfail}
>> +
>> +exit $ret

  reply	other threads:[~2020-08-14 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200811195003.1812-1-mathieu.desnoyers@efficios.com>
2020-08-11 19:50 ` [PATCH 1/3] selftests: Add VRF icmp error route lookup test Mathieu Desnoyers
2020-08-13 23:13   ` David Ahern
2020-08-14 14:05     ` Michael Jeanson [this message]
2020-08-11 19:50 ` [PATCH 2/3] ipv4/icmp: l3mdev: Perform icmp error route lookup on source device routing table Mathieu Desnoyers
2020-08-12 21:43   ` David Miller
2020-08-13 13:12     ` Mathieu Desnoyers
2020-08-13 22:59   ` David Ahern
2020-08-11 19:50 ` [PATCH 3/3] ipv6/icmp: " Mathieu Desnoyers
2020-08-13 23:21   ` David Ahern

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=217122726.8258.1597413920624.JavaMail.zimbra@efficios.com \
    --to=mjeanson@efficios.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=netdev@vger.kernel.org \
    /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).