]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
selftests: forwarding: Change inappropriate log_test_skip() calls
authorPetr Machata <petrm@nvidia.com>
Tue, 26 Mar 2024 16:54:34 +0000 (17:54 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 29 Mar 2024 01:03:42 +0000 (18:03 -0700)
The SKIP return should be used for cases where tooling of the machine under
test is lacking. For cases where HW is lacking, the appropriate outcome is
XFAIL.

This is the case with ethtool_rmon and mlxsw_lib. For these, introduce a
new helper, log_test_xfail().

Do the same for router_mpath_nh_lib. Note that it will be fixed using a
more reusable way in a following patch.

For the two resource_scale selftests, the log should simply not be written,
because there is no problem.

Cc: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Link: https://lore.kernel.org/r/3d668d8fb6fa0d9eeb47ce6d9e54114348c7c179.1711464583.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/ethtool_rmon.sh
tools/testing/selftests/drivers/net/mlxsw/mlxsw_lib.sh
tools/testing/selftests/drivers/net/mlxsw/spectrum-2/resource_scale.sh
tools/testing/selftests/drivers/net/mlxsw/spectrum/resource_scale.sh
tools/testing/selftests/net/forwarding/lib.sh
tools/testing/selftests/net/forwarding/router_mpath_nh_lib.sh

index 709433a4c8860fc133520da8da5d933bfeab4a2b..e2a1c10d35035c382396a1ebb765ae3cc7f3ee8c 100755 (executable)
@@ -79,7 +79,7 @@ rmon_histogram()
 
                for if in $iface $neigh; do
                        if ! ensure_mtu $if ${bucket[0]}; then
-                               log_test_skip "$if does not support the required MTU for $step"
+                               log_test_xfail "$if does not support the required MTU for $step"
                                return
                        fi
                done
@@ -94,7 +94,7 @@ rmon_histogram()
                jq -r ".[0].rmon[\"${set}-pktsNtoM\"][]|[.low, .high]|@tsv" 2>/dev/null)
 
        if [ $nbuckets -eq 0 ]; then
-               log_test_skip "$iface does not support $set histogram counters"
+               log_test_xfail "$iface does not support $set histogram counters"
                return
        fi
 }
index 6369927e9c378b015842fb600e88e8da621f7d1f..48395cfd4f95875d56f705df5563cd6a0d98ad82 100644 (file)
@@ -42,7 +42,7 @@ __mlxsw_only_on_spectrum()
        local src=$1; shift
 
        if ! mlxsw_on_spectrum "$rev"; then
-               log_test_skip $src:$caller "(Spectrum-$rev only)"
+               log_test_xfail $src:$caller "(Spectrum-$rev only)"
                return 1
        fi
 }
index a88d8a8c85f2e01f63a24ef1b8e272a05f1be9f5..899b6892603fd0ea17ad2d18f50c902b4d9249b4 100755 (executable)
@@ -47,7 +47,6 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
                RET=0
                target=$(${current_test}_get_target "$should_fail")
                if ((target == 0)); then
-                       log_test_skip "'$current_test' should_fail=$should_fail test"
                        continue
                fi
 
index f981c957f09759996d030d51284aed495b45b9c8..482ebb744ebad8a75635eb103a5123c11fdb7b17 100755 (executable)
@@ -52,7 +52,6 @@ for current_test in ${TESTS:-$ALL_TESTS}; do
                        RET=0
                        target=$(${current_test}_get_target "$should_fail")
                        if ((target == 0)); then
-                               log_test_skip "'$current_test' [$profile] should_fail=$should_fail test"
                                continue
                        fi
                        ${current_test}_setup_prepare
index ca433ba3612ee77d06346c56c342943513ce0499..5415b8d29862910f3fac443f64d524f3a202f810 100644 (file)
@@ -467,6 +467,15 @@ log_test_skip()
        return 0
 }
 
+log_test_xfail()
+{
+       local test_name=$1
+       local opt_str=$2
+
+       printf "TEST: %-60s  [XFAIL]\n" "$test_name $opt_str"
+       return 0
+}
+
 log_info()
 {
        local msg=$1
index 7e7d62161c345a45fde2c05131ab0d64d9f18075..b2d2c6cecc01eae4d9637516a2bfdcc69b61054a 100644 (file)
@@ -69,7 +69,7 @@ nh_stats_test_dispatch_swhw()
                nh_stats_do_test "HW $what" "$nh1_id" "$nh2_id" "$group_id" \
                                 nh_stats_get_hw "${mz[@]}"
        elif [[ $kind == veth ]]; then
-               log_test_skip "HW stats not offloaded on veth topology"
+               log_test_xfail "HW stats not offloaded on veth topology"
        fi
 }