summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIdo Schimmel <idosch@nvidia.com>2023-08-08 17:14:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-16 19:27:25 +0300
commit1455765e28ce78c29c0c92484d394a965d2d1c56 (patch)
tree54c011f82427a42c4ce6378b002bd89642808ae2 /tools
parente146162dcf2e4d486df8d76f6587b8819cf538bc (diff)
downloadlinux-1455765e28ce78c29c0c92484d394a965d2d1c56.tar.xz
selftests: forwarding: Add a helper to skip test when using veth pairs
commit 66e131861ab7bf754b50813216f5c6885cd32d63 upstream. 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: 64916b57c0b1 ("selftests: forwarding: Add speed and auto-negotiation test") Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Petr Machata <petrm@nvidia.com> Tested-by: Mirsad Todorovac <mirsad.todorovac@alu.unizg.hr> Reviewed-by: Hangbin Liu <liuhangbin@gmail.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Link: https://lore.kernel.org/r/20230808141503.4060661-7-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/testing/selftests/net/forwarding/lib.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh
index fbe4e37cf26e..7ca2e07680bd 100755
--- a/tools/testing/selftests/net/forwarding/lib.sh
+++ b/tools/testing/selftests/net/forwarding/lib.sh
@@ -138,6 +138,17 @@ check_locked_port_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