@@ -4,7 +4,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"
mptcp_lib_ns_init
-ksft_skip=4
flush_pids()
{
@@ -33,12 +32,12 @@ mptcp_lib_check_mptcp
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
ss -h | grep -q MPTCP
if [ $? -ne 0 ];then
echo "SKIP: ss tool does not support MPTCP"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
get_msk_inuse()
@@ -8,7 +8,6 @@ time_start=$(date +%s)
optstring="S:R:d:e:l:r:h4cm:f:tC"
final_ret=0
cin_disconnect=""
-ksft_skip=4
ipv6=true
ethtool_random_on=true
tc_delay="$((RANDOM%50))"
@@ -132,7 +131,7 @@ mptcp_lib_check_kallsyms
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
capout=$(mktemp)
@@ -229,7 +228,7 @@ fi
check_mptcp_disabled()
{
local disabled_ns="ns_disabled-$rndh"
- ip netns add ${disabled_ns} || exit $ksft_skip
+ ip netns add ${disabled_ns} || exit ${KSFT_SKIP}
# net.mptcp.enabled should be enabled by default
if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ print $3 }')" -ne 1 ]; then
@@ -17,7 +17,6 @@ cinfail=""
cinsent=""
tmpfile=""
capout=""
-ksft_skip=4
iptables="iptables"
ip6tables="ip6tables"
ip_mptcp=0
@@ -126,7 +125,7 @@ check_tools()
if ! ip -Version &> /dev/null; then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
# Use the legacy version if available to support old kernel versions
@@ -135,10 +134,10 @@ check_tools()
ip6tables="ip6tables-legacy"
elif ! iptables -V &> /dev/null; then
echo "SKIP: Could not run all tests without iptables tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
elif ! ip6tables -V &> /dev/null; then
echo "SKIP: Could not run all tests without ip6tables tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
}
@@ -394,15 +393,15 @@ setup_fail_rules()
-p tcp \
-m length --length 150:9999 \
-m statistic --mode nth --packet 1 --every 99999 \
- -j MARK --set-mark 42 || return ${ksft_skip}
+ -j MARK --set-mark 42 || return ${KSFT_SKIP}
- tc -n $ns2 qdisc add dev ns2eth$i clsact || return ${ksft_skip}
+ tc -n $ns2 qdisc add dev ns2eth$i clsact || return ${KSFT_SKIP}
tc -n $ns2 filter add dev ns2eth$i egress \
protocol ip prio 1000 \
handle 42 fw \
action pedit munge offset 148 u8 invert \
pipe csum tcp \
- index 100 || return ${ksft_skip}
+ index 100 || return ${KSFT_SKIP}
}
reset_with_fail()
@@ -416,7 +415,7 @@ reset_with_fail()
local rc=0
setup_fail_rules "${@}" || rc=$?
- if [ ${rc} -eq ${ksft_skip} ]; then
+ if [ ${rc} -eq ${KSFT_SKIP} ]; then
mark_as_skipped "unable to set the 'fail' rules"
return 1
fi
@@ -499,7 +499,7 @@ mptcp_lib_ns_init() {
local netns
for netns in "$ns1" "$ns2" "$ns3" "$ns4"; do
- ip netns add $netns || exit ${ksft_skip}
+ ip netns add $netns || exit ${KSFT_SKIP}
ip -net $netns link set lo up
ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=0
@@ -3,7 +3,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"
-ksft_skip=4
iptables="iptables"
ip6tables="ip6tables"
@@ -74,7 +73,7 @@ mptcp_lib_check_kallsyms
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
# Use the legacy version if available to support old kernel versions
@@ -83,10 +82,10 @@ if iptables-legacy -V &> /dev/null; then
ip6tables="ip6tables-legacy"
elif ! iptables -V &> /dev/null; then
echo "SKIP: Could not run all tests without iptables tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
elif ! ip6tables -V &> /dev/null; then
echo "SKIP: Could not run all tests without ip6tables tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
check_mark()
@@ -3,8 +3,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"
-ksft_skip=4
-
usage() {
echo "Usage: $0 [ -h ]"
}
@@ -36,7 +34,7 @@ mptcp_lib_check_mptcp
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
trap cleanup EXIT
@@ -4,7 +4,6 @@
. "$(dirname "${0}")/mptcp_lib.sh"
mptcp_lib_ns_init
-ksft_skip=4
bail=0
slack=50
large=""
@@ -33,7 +32,7 @@ mptcp_lib_check_mptcp
ip -Version > /dev/null 2>&1
if [ $? -ne 0 ];then
echo "SKIP: Could not run test without ip tool"
- exit $ksft_skip
+ exit ${KSFT_SKIP}
fi
# "$ns1" ns2 ns3
This patch uses the public var KSFT_SKIP in mptcp_lib.sh instead of ksft_skip, and drop every 'ksft_skip=4'. Signed-off-by: Geliang Tang <geliang.tang@suse.com> --- tools/testing/selftests/net/mptcp/diag.sh | 5 ++--- .../testing/selftests/net/mptcp/mptcp_connect.sh | 5 ++--- tools/testing/selftests/net/mptcp/mptcp_join.sh | 15 +++++++-------- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 2 +- .../testing/selftests/net/mptcp/mptcp_sockopt.sh | 7 +++---- tools/testing/selftests/net/mptcp/pm_netlink.sh | 4 +--- tools/testing/selftests/net/mptcp/simult_flows.sh | 3 +-- 7 files changed, 17 insertions(+), 24 deletions(-)