mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 14:40:12 -04:00
selftests: fib_rule_tests: Clarify test results
Clarify the test results by grouping the output of test cases belonging
to the same test under a common title. This is consistent with the
output of fib_tests.sh.
Before:
# ./fib_rule_tests.sh
TEST: rule6 check: oif redirect to table [ OK ]
TEST: rule6 del by pref: oif redirect to table [ OK ]
[...]
TEST: rule4 check: oif redirect to table [ OK ]
TEST: rule4 del by pref: oif redirect to table [ OK ]
[...]
Tests passed: 116
Tests failed: 0
After:
# ./fib_rule_tests.sh
IPv6 FIB rule tests
TEST: rule6 check: oif redirect to table [ OK ]
TEST: rule6 del by pref: oif redirect to table [ OK ]
[...]
IPv4 FIB rule tests
TEST: rule4 check: oif redirect to table [ OK ]
TEST: rule4 del by pref: oif redirect to table [ OK ]
[...]
Tests passed: 116
Tests failed: 0
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20240814111005.955359-3-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
30dcdd6a3a
commit
b1487d6abe
@@ -35,18 +35,13 @@ log_test()
|
||||
local expected=$2
|
||||
local msg="$3"
|
||||
|
||||
$IP rule show | grep -q l3mdev
|
||||
if [ $? -eq 0 ]; then
|
||||
msg="$msg (VRF)"
|
||||
fi
|
||||
|
||||
if [ ${rc} -eq ${expected} ]; then
|
||||
nsuccess=$((nsuccess+1))
|
||||
printf "\n TEST: %-60s [ OK ]\n" "${msg}"
|
||||
printf " TEST: %-60s [ OK ]\n" "${msg}"
|
||||
else
|
||||
ret=1
|
||||
nfail=$((nfail+1))
|
||||
printf "\n TEST: %-60s [FAIL]\n" "${msg}"
|
||||
printf " TEST: %-60s [FAIL]\n" "${msg}"
|
||||
if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
|
||||
echo
|
||||
echo "hit enter to continue, 'q' to quit"
|
||||
@@ -205,10 +200,14 @@ fib_rule6_test_reject()
|
||||
|
||||
fib_rule6_test()
|
||||
{
|
||||
local ext_name=$1; shift
|
||||
local getmatch
|
||||
local match
|
||||
local cnt
|
||||
|
||||
echo
|
||||
echo "IPv6 FIB rule tests $ext_name"
|
||||
|
||||
# setup the fib rule redirect route
|
||||
$IP -6 route add table $RTABLE default via $GW_IP6 dev $DEV onlink
|
||||
|
||||
@@ -267,7 +266,7 @@ fib_rule6_test()
|
||||
fib_rule6_vrf_test()
|
||||
{
|
||||
setup_vrf
|
||||
fib_rule6_test
|
||||
fib_rule6_test "- with VRF"
|
||||
cleanup_vrf
|
||||
}
|
||||
|
||||
@@ -277,6 +276,9 @@ fib_rule6_connect_test()
|
||||
{
|
||||
local dsfield
|
||||
|
||||
echo
|
||||
echo "IPv6 FIB rule connect tests"
|
||||
|
||||
if ! check_nettest; then
|
||||
echo "SKIP: Could not run test without nettest tool"
|
||||
return
|
||||
@@ -344,10 +346,14 @@ fib_rule4_test_reject()
|
||||
|
||||
fib_rule4_test()
|
||||
{
|
||||
local ext_name=$1; shift
|
||||
local getmatch
|
||||
local match
|
||||
local cnt
|
||||
|
||||
echo
|
||||
echo "IPv4 FIB rule tests $ext_name"
|
||||
|
||||
# setup the fib rule redirect route
|
||||
$IP route add table $RTABLE default via $GW_IP4 dev $DEV onlink
|
||||
|
||||
@@ -411,7 +417,7 @@ fib_rule4_test()
|
||||
fib_rule4_vrf_test()
|
||||
{
|
||||
setup_vrf
|
||||
fib_rule4_test
|
||||
fib_rule4_test "- with VRF"
|
||||
cleanup_vrf
|
||||
}
|
||||
|
||||
@@ -421,6 +427,9 @@ fib_rule4_connect_test()
|
||||
{
|
||||
local dsfield
|
||||
|
||||
echo
|
||||
echo "IPv4 FIB rule connect tests"
|
||||
|
||||
if ! check_nettest; then
|
||||
echo "SKIP: Could not run test without nettest tool"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user