aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh
diff options
context:
space:
mode:
authorPo-Hsu Lin <po-hsu.lin@canonical.com>2021-08-23 16:58:54 +0800
committerJakub Kicinski <kuba@kernel.org>2021-08-24 16:49:09 -0700
commit7844ec21a915cc60f1e2cd8682b943b916a7d2fc (patch)
treec5b2bd3a9dd5648d69b1e894bd6b4ec95767494b /tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh
parentMerge branch 'ethtool-extend-coalesce-uapi' (diff)
downloadlinux-dev-7844ec21a915cc60f1e2cd8682b943b916a7d2fc.tar.xz
linux-dev-7844ec21a915cc60f1e2cd8682b943b916a7d2fc.zip
selftests/net: Use kselftest skip code for skipped tests
There are several test cases in the net directory are still using exit 0 or exit 1 when they need to be skipped. Use kselftest framework skip code instead so it can help us to distinguish the return status. Criterion to filter out what should be fixed in net directory: grep -r "exit [01]" -B1 | grep -i skip This change might cause some false-positives if people are running these test scripts directly and only checking their return codes, which will change from 0 to 4. However I think the impact should be small as most of our scripts here are already using this skip code. And there will be no such issue if running them with the kselftest framework. Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com> Reviewed-by: Ido Schimmel <idosch@nvidia.com> Tested-by: Ido Schimmel <idosch@nvidia.com> Link: https://lore.kernel.org/r/20210823085854.40216-1-po-hsu.lin@canonical.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh')
-rwxr-xr-xtools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh b/tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh
index 68708f5e26a0..b9b06ef80d88 100755
--- a/tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh
+++ b/tools/testing/selftests/net/srv6_end_dt6_l3vpn_test.sh
@@ -164,6 +164,9 @@
# +---------------------------------------------------+
#
+# Kselftest framework requirement - SKIP code is 4.
+ksft_skip=4
+
readonly LOCALSID_TABLE_ID=90
readonly IPv6_RT_NETWORK=fd00
readonly IPv6_HS_NETWORK=cafe
@@ -472,18 +475,18 @@ host_vpn_isolation_tests()
if [ "$(id -u)" -ne 0 ];then
echo "SKIP: Need root privileges"
- exit 0
+ exit $ksft_skip
fi
if [ ! -x "$(command -v ip)" ]; then
echo "SKIP: Could not run test without ip tool"
- exit 0
+ exit $ksft_skip
fi
modprobe vrf &>/dev/null
if [ ! -e /proc/sys/net/vrf/strict_mode ]; then
echo "SKIP: vrf sysctl does not exist"
- exit 0
+ exit $ksft_skip
fi
cleanup &>/dev/null