Commit f30b04ca authored by Geliang Tang's avatar Geliang Tang Committed by David S. Miller
Browse files

selftests: mptcp: add tc check for check_tools



tc are used in some test scripts: mptcp_connect.sh, mptcp_join.sh and
simult_flows.sh. It makes sense to check if tc is installed before running
these scripts, just like other tools. So this patch add 'tc' check for
mptcp_lib_check_tools(), and check it in these test scripts.

Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarMatthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2c3a7eb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ cleanup()

mptcp_lib_check_mptcp
mptcp_lib_check_kallsyms
mptcp_lib_check_tools ip
mptcp_lib_check_tools ip tc

sin=$(mktemp)
sout=$(mktemp)
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ init() {

	mptcp_lib_check_mptcp
	mptcp_lib_check_kallsyms
	mptcp_lib_check_tools ip ss "${iptables}" "${ip6tables}"
	mptcp_lib_check_tools ip tc ss "${iptables}" "${ip6tables}"

	sin=$(mktemp)
	sout=$(mktemp)
+6 −0
Original line number Diff line number Diff line
@@ -384,6 +384,12 @@ mptcp_lib_check_tools() {
				exit ${KSFT_SKIP}
			fi
			;;
		"tc")
			if ! tc -help &> /dev/null; then
				mptcp_lib_pr_skip "Could not run test without tc tool"
				exit ${KSFT_SKIP}
			fi
			;;
		"ss")
			if ! ss -h | grep -q MPTCP; then
				mptcp_lib_pr_skip "ss tool does not support MPTCP"
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ cleanup()
}

mptcp_lib_check_mptcp
mptcp_lib_check_tools ip
mptcp_lib_check_tools ip tc

#  "$ns1"              ns2                    ns3
#     ns1eth1    ns2eth1   ns2eth3      ns3eth1