2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 01:04:08 +08:00

selftests: Fix detection of nettest command in fcnal-test

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: 6f9d5cacfe ("selftests: Setup for functional tests for fib and socket lookups")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David Ahern 2019-08-09 16:13:38 -07:00 committed by David S. Miller
parent f52ea3c55a
commit f887427b2c

View File

@ -998,13 +998,6 @@ ipv4_tcp_vrf()
ipv4_tcp() ipv4_tcp()
{ {
log_section "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" log_subsection "No VRF"
setup setup
@ -1375,12 +1368,6 @@ ipv4_udp_vrf()
ipv4_udp() ipv4_udp()
{ {
which nettest >/dev/null
if [ $? -ne 0 ]; then
log_error "nettest not found; skipping tests"
return
fi
log_section "IPv4/UDP" log_section "IPv4/UDP"
log_subsection "No VRF" log_subsection "No VRF"
@ -2314,13 +2301,6 @@ ipv6_tcp_vrf()
ipv6_tcp() ipv6_tcp()
{ {
log_section "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" log_subsection "No VRF"
setup setup
@ -3156,12 +3136,6 @@ netfilter_icmp()
ipv4_netfilter() ipv4_netfilter()
{ {
which nettest >/dev/null
if [ $? -ne 0 ]; then
log_error "nettest not found; skipping tests"
return
fi
log_section "IPv4 Netfilter" log_section "IPv4 Netfilter"
log_subsection "TCP reset" log_subsection "TCP reset"
@ -3219,12 +3193,6 @@ netfilter_icmp6()
ipv6_netfilter() ipv6_netfilter()
{ {
which nettest >/dev/null
if [ $? -ne 0 ]; then
log_error "nettest not found; skipping tests"
return
fi
log_section "IPv6 Netfilter" log_section "IPv6 Netfilter"
log_subsection "TCP reset" log_subsection "TCP reset"
@ -3422,6 +3390,12 @@ elif [ "$TESTS" = "ipv6" ]; then
TESTS="$TESTS_IPV6" TESTS="$TESTS_IPV6"
fi 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 nfail=0
declare -i nsuccess=0 declare -i nsuccess=0