Commit 66e13186 authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

selftests: forwarding: Add a helper to skip test when using veth pairs

A handful of tests require physical loopbacks to be used instead of veth
pairs. Add a helper that these tests will invoke in order to be skipped
when executed with veth pairs.

Fixes: 64916b57 ("selftests: forwarding: Add speed and auto-negotiation test")
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Tested-by: default avatarMirsad Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: default avatarHangbin Liu <liuhangbin@gmail.com>
Acked-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Link: https://lore.kernel.org/r/20230808141503.4060661-7-idosch@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 38f7c44d
......@@ -164,6 +164,17 @@ check_port_mab_support()
fi
}
skip_on_veth()
{
local kind=$(ip -j -d link show dev ${NETIFS[p1]} |
jq -r '.[].linkinfo.info_kind')
if [[ $kind == veth ]]; then
echo "SKIP: Test cannot be run with veth pairs"
exit $ksft_skip
fi
}
if [[ "$(id -u)" -ne 0 ]]; then
echo "SKIP: need root privileges"
exit $ksft_skip
......
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