Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 6f9d5cacfe07 ("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>

authored by

David Ahern and committed by
David S. Miller
f887427b f52ea3c5

+6 -32
+6 -32
tools/testing/selftests/net/fcnal-test.sh
··· 998 998 ipv4_tcp() 999 999 { 1000 1000 log_section "IPv4/TCP" 1001 - 1002 - which nettest >/dev/null 1003 - if [ $? -ne 0 ]; then 1004 - log_error "nettest not found; skipping tests" 1005 - return 1006 - fi 1007 - 1008 1001 log_subsection "No VRF" 1009 1002 setup 1010 1003 ··· 1368 1375 1369 1376 ipv4_udp() 1370 1377 { 1371 - which nettest >/dev/null 1372 - if [ $? -ne 0 ]; then 1373 - log_error "nettest not found; skipping tests" 1374 - return 1375 - fi 1376 - 1377 1378 log_section "IPv4/UDP" 1378 1379 log_subsection "No VRF" 1379 1380 ··· 2301 2314 ipv6_tcp() 2302 2315 { 2303 2316 log_section "IPv6/TCP" 2304 - 2305 - which nettest >/dev/null 2306 - if [ $? -ne 0 ]; then 2307 - log_error "nettest not found; skipping tests" 2308 - return 2309 - fi 2310 - 2311 2317 log_subsection "No VRF" 2312 2318 setup 2313 2319 ··· 3136 3156 3137 3157 ipv4_netfilter() 3138 3158 { 3139 - which nettest >/dev/null 3140 - if [ $? -ne 0 ]; then 3141 - log_error "nettest not found; skipping tests" 3142 - return 3143 - fi 3144 - 3145 3159 log_section "IPv4 Netfilter" 3146 3160 log_subsection "TCP reset" 3147 3161 ··· 3193 3219 3194 3220 ipv6_netfilter() 3195 3221 { 3196 - which nettest >/dev/null 3197 - if [ $? -ne 0 ]; then 3198 - log_error "nettest not found; skipping tests" 3199 - return 3200 - fi 3201 - 3202 3222 log_section "IPv6 Netfilter" 3203 3223 log_subsection "TCP reset" 3204 3224 ··· 3388 3420 TESTS="$TESTS_IPV4" 3389 3421 elif [ "$TESTS" = "ipv6" ]; then 3390 3422 TESTS="$TESTS_IPV6" 3423 + fi 3424 + 3425 + which nettest >/dev/null 3426 + if [ $? -ne 0 ]; then 3427 + echo "'nettest' command not found; skipping tests" 3428 + exit 0 3391 3429 fi 3392 3430 3393 3431 declare -i nfail=0