Skip to content

Commit

Permalink
selftests: icmp_redirect: support expected failures
Browse files Browse the repository at this point in the history
According to a comment in commit 99513cf ("selftest: Fixes for
icmp_redirect test") the test "IPv6: mtu exception plus redirect" is
expected to fail, because of a bug in the IPv6 logic that hasn't been
fixed yet apparently.

We should probably consider this failure as an "expected failure",
therefore change the script to return XFAIL for that particular test and
also report the total amount of expected failures at the end of the run.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
arighi authored and davem330 committed Jun 23, 2021
1 parent e940eb3 commit 0a36a75
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/testing/selftests/net/icmp_redirect.sh
Expand Up @@ -63,10 +63,14 @@ log_test()
local rc=$1
local expected=$2
local msg="$3"
local xfail=$4

if [ ${rc} -eq ${expected} ]; then
printf "TEST: %-60s [ OK ]\n" "${msg}"
nsuccess=$((nsuccess+1))
elif [ ${rc} -eq ${xfail} ]; then
printf "TEST: %-60s [XFAIL]\n" "${msg}"
nxfail=$((nxfail+1))
else
ret=1
nfail=$((nfail+1))
Expand Down Expand Up @@ -322,7 +326,7 @@ check_exception()
ip -netns h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
grep -v "mtu" | grep -q "${R1_LLADDR}"
fi
log_test $? 0 "IPv6: ${desc}"
log_test $? 0 "IPv6: ${desc}" 1
}

run_ping()
Expand Down Expand Up @@ -488,6 +492,7 @@ which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
ret=0
nsuccess=0
nfail=0
nxfail=0

while getopts :pv o
do
Expand Down Expand Up @@ -532,5 +537,6 @@ fi

printf "\nTests passed: %3d\n" ${nsuccess}
printf "Tests failed: %3d\n" ${nfail}
printf "Tests xfailed: %3d\n" ${nxfail}

exit $ret

0 comments on commit 0a36a75

Please sign in to comment.