netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: [PATCH net-next] selftests: Fix detection of nettest command in fcnal-test
Date: Fri,  9 Aug 2019 16:13:38 -0700	[thread overview]
Message-ID: <20190809231338.29105-1-dsahern@kernel.org> (raw)

From: David Ahern <dsahern@gmail.com>

Most of the tests run by fcnal-test.sh relies on the nettest command.
Rather than trying to cover all of the individual tests, check for the
binary only at the beginning.

Also removes the need for log_error which is undefined.

Fixes: 6f9d5cacfe07 ("selftests: Setup for functional tests for fib and socket lookups")
Signed-off-by: David Ahern <dsahern@gmail.com>
---
 tools/testing/selftests/net/fcnal-test.sh | 38 +++++--------------------------
 1 file changed, 6 insertions(+), 32 deletions(-)

diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index bd6b564382ec..9fd3a0b97f0d 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -998,13 +998,6 @@ ipv4_tcp_vrf()
 ipv4_tcp()
 {
 	log_section "IPv4/TCP"
-
-	which nettest >/dev/null
-	if [ $? -ne 0 ]; then
-		log_error "nettest not found; skipping tests"
-		return
-	fi
-
 	log_subsection "No VRF"
 	setup
 
@@ -1375,12 +1368,6 @@ ipv4_udp_vrf()
 
 ipv4_udp()
 {
-	which nettest >/dev/null
-	if [ $? -ne 0 ]; then
-		log_error "nettest not found; skipping tests"
-		return
-	fi
-
 	log_section "IPv4/UDP"
 	log_subsection "No VRF"
 
@@ -2314,13 +2301,6 @@ ipv6_tcp_vrf()
 ipv6_tcp()
 {
 	log_section "IPv6/TCP"
-
-	which nettest >/dev/null
-	if [ $? -ne 0 ]; then
-		log_error "nettest not found; skipping tests"
-		return
-	fi
-
 	log_subsection "No VRF"
 	setup
 
@@ -3156,12 +3136,6 @@ netfilter_icmp()
 
 ipv4_netfilter()
 {
-	which nettest >/dev/null
-	if [ $? -ne 0 ]; then
-		log_error "nettest not found; skipping tests"
-		return
-	fi
-
 	log_section "IPv4 Netfilter"
 	log_subsection "TCP reset"
 
@@ -3219,12 +3193,6 @@ netfilter_icmp6()
 
 ipv6_netfilter()
 {
-	which nettest >/dev/null
-	if [ $? -ne 0 ]; then
-		log_error "nettest not found; skipping tests"
-		return
-	fi
-
 	log_section "IPv6 Netfilter"
 	log_subsection "TCP reset"
 
@@ -3422,6 +3390,12 @@ elif [ "$TESTS" = "ipv6" ]; then
 	TESTS="$TESTS_IPV6"
 fi
 
+which nettest >/dev/null
+if [ $? -ne 0 ]; then
+	echo "'nettest' command not found; skipping tests"
+	exit 0
+fi
+
 declare -i nfail=0
 declare -i nsuccess=0
 
-- 
2.11.0


             reply	other threads:[~2019-08-09 23:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 23:13 David Ahern [this message]
2019-08-10  2:54 ` [PATCH net-next] selftests: Fix detection of nettest command in fcnal-test David Miller

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=20190809231338.29105-1-dsahern@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.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).