]> git.baikalelectronics.ru Git - kernel.git/commitdiff
selftests: fib rule: Log test description
authorGuillaume Nault <gnault@redhat.com>
Mon, 31 Jan 2022 15:42:06 +0000 (16:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 1 Feb 2022 14:14:47 +0000 (14:14 +0000)
All callers of fib_rule6_test_match_n_redirect() and
fib_rule4_test_match_n_redirect() pass a third argument containing a
description of the test being run. Instead of ignoring this argument,
let's use it for logging instead of printing a truncated version of the
command.

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/net/fib_rule_tests.sh

index 012f9385d68cd1ac8a4f69f63bf47a9ba2327597..6a05e81fc81dbaca4fa7a6edf25c215f74b8522e 100755 (executable)
@@ -104,13 +104,14 @@ fib_rule6_test_match_n_redirect()
 {
        local match="$1"
        local getmatch="$2"
+       local description="$3"
 
        $IP -6 rule add $match table $RTABLE
        $IP -6 route get $GW_IP6 $getmatch | grep -q "table $RTABLE"
-       log_test $? 0 "rule6 check: $1"
+       log_test $? 0 "rule6 check: $description"
 
        fib_rule6_del_by_pref "$match"
-       log_test $? 0 "rule6 del by pref: $match"
+       log_test $? 0 "rule6 del by pref: $description"
 }
 
 fib_rule6_test()
@@ -176,13 +177,14 @@ fib_rule4_test_match_n_redirect()
 {
        local match="$1"
        local getmatch="$2"
+       local description="$3"
 
        $IP rule add $match table $RTABLE
        $IP route get $GW_IP4 $getmatch | grep -q "table $RTABLE"
-       log_test $? 0 "rule4 check: $1"
+       log_test $? 0 "rule4 check: $description"
 
        fib_rule4_del_by_pref "$match"
-       log_test $? 0 "rule4 del by pref: $match"
+       log_test $? 0 "rule4 del by pref: $description"
 }
 
 fib_rule4_test()