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: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Geliang Tang 2024-04-05 12:52:05 +02:00 committed by David S. Miller
parent d2c3a7eb1a
commit f30b04cacd
4 changed files with 9 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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"

View File

@ -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