Commit b1487d6a authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

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: default avatarIdo Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20240814111005.955359-3-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 30dcdd6a
...@@ -35,18 +35,13 @@ log_test() ...@@ -35,18 +35,13 @@ log_test()
local expected=$2 local expected=$2
local msg="$3" local msg="$3"
$IP rule show | grep -q l3mdev
if [ $? -eq 0 ]; then
msg="$msg (VRF)"
fi
if [ ${rc} -eq ${expected} ]; then if [ ${rc} -eq ${expected} ]; then
nsuccess=$((nsuccess+1)) nsuccess=$((nsuccess+1))
printf "\n TEST: %-60s [ OK ]\n" "${msg}" printf " TEST: %-60s [ OK ]\n" "${msg}"
else else
ret=1 ret=1
nfail=$((nfail+1)) nfail=$((nfail+1))
printf "\n TEST: %-60s [FAIL]\n" "${msg}" printf " TEST: %-60s [FAIL]\n" "${msg}"
if [ "${PAUSE_ON_FAIL}" = "yes" ]; then if [ "${PAUSE_ON_FAIL}" = "yes" ]; then
echo echo
echo "hit enter to continue, 'q' to quit" echo "hit enter to continue, 'q' to quit"
...@@ -205,10 +200,14 @@ fib_rule6_test_reject() ...@@ -205,10 +200,14 @@ fib_rule6_test_reject()
fib_rule6_test() fib_rule6_test()
{ {
local ext_name=$1; shift
local getmatch local getmatch
local match local match
local cnt local cnt
echo
echo "IPv6 FIB rule tests $ext_name"
# setup the fib rule redirect route # setup the fib rule redirect route
$IP -6 route add table $RTABLE default via $GW_IP6 dev $DEV onlink $IP -6 route add table $RTABLE default via $GW_IP6 dev $DEV onlink
...@@ -267,7 +266,7 @@ fib_rule6_test() ...@@ -267,7 +266,7 @@ fib_rule6_test()
fib_rule6_vrf_test() fib_rule6_vrf_test()
{ {
setup_vrf setup_vrf
fib_rule6_test fib_rule6_test "- with VRF"
cleanup_vrf cleanup_vrf
} }
...@@ -277,6 +276,9 @@ fib_rule6_connect_test() ...@@ -277,6 +276,9 @@ fib_rule6_connect_test()
{ {
local dsfield local dsfield
echo
echo "IPv6 FIB rule connect tests"
if ! check_nettest; then if ! check_nettest; then
echo "SKIP: Could not run test without nettest tool" echo "SKIP: Could not run test without nettest tool"
return return
...@@ -344,10 +346,14 @@ fib_rule4_test_reject() ...@@ -344,10 +346,14 @@ fib_rule4_test_reject()
fib_rule4_test() fib_rule4_test()
{ {
local ext_name=$1; shift
local getmatch local getmatch
local match local match
local cnt local cnt
echo
echo "IPv4 FIB rule tests $ext_name"
# setup the fib rule redirect route # setup the fib rule redirect route
$IP route add table $RTABLE default via $GW_IP4 dev $DEV onlink $IP route add table $RTABLE default via $GW_IP4 dev $DEV onlink
...@@ -411,7 +417,7 @@ fib_rule4_test() ...@@ -411,7 +417,7 @@ fib_rule4_test()
fib_rule4_vrf_test() fib_rule4_vrf_test()
{ {
setup_vrf setup_vrf
fib_rule4_test fib_rule4_test "- with VRF"
cleanup_vrf cleanup_vrf
} }
...@@ -421,6 +427,9 @@ fib_rule4_connect_test() ...@@ -421,6 +427,9 @@ fib_rule4_connect_test()
{ {
local dsfield local dsfield
echo
echo "IPv4 FIB rule connect tests"
if ! check_nettest; then if ! check_nettest; then
echo "SKIP: Could not run test without nettest tool" echo "SKIP: Could not run test without nettest tool"
return return
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment