selftests: net: fix IOAM test skip return code
The ioam6.sh test script exits with an error code (1) when tests are skipped due to lack of support from userspace/kernel or not enough permissions. It should return the kselftests SKIP code instead. Reviewed-by: Justin Iurman <justin.iurman@uliege.be> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> Link: https://lore.kernel.org/r/20220801124615.256416-1-kleber.souza@canonical.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Родитель
969e26c63d
Коммит
1995943c3f
|
@ -117,6 +117,8 @@
|
||||||
# | Schema Data | |
|
# | Schema Data | |
|
||||||
# +-----------------------------------------------------------+
|
# +-----------------------------------------------------------+
|
||||||
|
|
||||||
|
# Kselftest framework requirement - SKIP code is 4.
|
||||||
|
ksft_skip=4
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# #
|
# #
|
||||||
|
@ -211,7 +213,7 @@ check_kernel_compatibility()
|
||||||
echo "SKIP: kernel version probably too old, missing ioam support"
|
echo "SKIP: kernel version probably too old, missing ioam support"
|
||||||
ip link del veth0 2>/dev/null || true
|
ip link del veth0 2>/dev/null || true
|
||||||
ip netns del ioam-tmp-node || true
|
ip netns del ioam-tmp-node || true
|
||||||
exit 1
|
exit $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip -netns ioam-tmp-node route add db02::/64 encap ioam6 mode inline \
|
ip -netns ioam-tmp-node route add db02::/64 encap ioam6 mode inline \
|
||||||
|
@ -227,7 +229,7 @@ check_kernel_compatibility()
|
||||||
"without CONFIG_IPV6_IOAM6_LWTUNNEL?"
|
"without CONFIG_IPV6_IOAM6_LWTUNNEL?"
|
||||||
ip link del veth0 2>/dev/null || true
|
ip link del veth0 2>/dev/null || true
|
||||||
ip netns del ioam-tmp-node || true
|
ip netns del ioam-tmp-node || true
|
||||||
exit 1
|
exit $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip link del veth0 2>/dev/null || true
|
ip link del veth0 2>/dev/null || true
|
||||||
|
@ -752,20 +754,20 @@ nfailed=0
|
||||||
if [ "$(id -u)" -ne 0 ]
|
if [ "$(id -u)" -ne 0 ]
|
||||||
then
|
then
|
||||||
echo "SKIP: Need root privileges"
|
echo "SKIP: Need root privileges"
|
||||||
exit 1
|
exit $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -x "$(command -v ip)" ]
|
if [ ! -x "$(command -v ip)" ]
|
||||||
then
|
then
|
||||||
echo "SKIP: Could not run test without ip tool"
|
echo "SKIP: Could not run test without ip tool"
|
||||||
exit 1
|
exit $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ip ioam &>/dev/null
|
ip ioam &>/dev/null
|
||||||
if [ $? = 1 ]
|
if [ $? = 1 ]
|
||||||
then
|
then
|
||||||
echo "SKIP: iproute2 too old, missing ioam command"
|
echo "SKIP: iproute2 too old, missing ioam command"
|
||||||
exit 1
|
exit $ksft_skip
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_kernel_compatibility
|
check_kernel_compatibility
|
||||||
|
|
Загрузка…
Ссылка в новой задаче