From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E59921CD11 for ; Fri, 16 Feb 2024 09:50:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077049; cv=none; b=WjTQ6n770cb6K8NvZ3E//C/xiU0PSgxukqLUMt+ibUtPkB4zz7bDoaAw81UzP6Y60D3Z59rBRXBpOU/I8n9zcQQuhiKpy4SQyi5wU22CTYNfcumX8YQk00XPvismnISfQTRLLQBYS191X7BxM0IanvBA7Eix6bEWZ+HR4VKjP7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077049; c=relaxed/simple; bh=lsy3LIvhqJZia+KnWNVSp/SgePLLwRZCUFDg5ixsKMk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nCwr2hSM3gqJ1rEgI3OZA3Q24ov0rRT0Sf/kZSv+DzSMnP/LgNOLmBN2aMwzVr1FYr1JIT8iWlVabAB/FfGJtOXIlGYb4ccRxQb/cKC9vc4UsNjCa19Oa0otXFvP60JlCChd9TU9POb5cEnZiq4gos2ywG0ZnZ1qaaiXldruh8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MrE2Ha2F; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MrE2Ha2F" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11DEEC4166C; Fri, 16 Feb 2024 09:50:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077048; bh=lsy3LIvhqJZia+KnWNVSp/SgePLLwRZCUFDg5ixsKMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MrE2Ha2FJMEwsraDL3VcFtZeik13n7l0AJV1HrmrZP6vG5KqSN+1NQccsXBm1A5l6 2b445rg8FvRCkWjrb6k6PMfFriYG/PBMMPx9i9vXT+UdeNZ/dW3LfBaSCb1TOCRu/Y aDiUkWFYFaWCQgVw3fsteI/h2RXBglpL8RUQa1VAv5JmfS2WpEyNUuqtDsC/qNmUzs 0S3DVoqO6sJTYl294xznhRwJgEuA5dB58qI50oRnGUxRqtWOvJu0SreMQshcSL9JVF i8JY/lwn0PZTvwny5wsswEU+IoRoybO4QZQp0mbTrh4vV3NqZQQXiCJcE18qvycIwY ynx3hg75SiLFA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 1/7] selftests: mptcp: netlink: drop duplicate var ret Date: Fri, 16 Feb 2024 17:50:29 +0800 Message-Id: <623ec6c806020fa46fd2c564b1e8bb9f35e20840.1708076886.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang The variable 'ret' are defined twice in pm_netlink.sh. This patch drops this duplicate one. Fixes: eedbc685321b ("selftests: add PM netlink functional tests") Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/pm_netlink.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testin= g/selftests/net/mptcp/pm_netlink.sh index 71899a3ffa7a..ebfefae71e13 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -28,7 +28,6 @@ sec=3D$(date +%s) rndh=3D$(printf %x $sec)-$(mktemp -u XXXXXX) ns1=3D"ns1-$rndh" err=3D$(mktemp) -ret=3D0 =20 cleanup() { --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8C1721CD11 for ; Fri, 16 Feb 2024 09:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077051; cv=none; b=ba/uCu7v0OlL06XKwF32LlGzuruBnSAjwaOcl8bGn1w1+JZUaJkY2jca24MmWXAnk5j/TNn1pfbETnqzc/USh92wFFw7PPfT2nPght3i5ZlQkP4zvC59VJ9dNdZ/vWc+iD62XikKJXxvnB+xtnVnWhquoloxSlpcnrxp73PTpXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077051; c=relaxed/simple; bh=jkU8fzHKVOY3XrQK/o8fGUMEv+lpAbJD1IclMBjSAxs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aVyB2FOyFd45aeKJKhIWR2k2KxEE2iQtPjFsqb62zih1FZoQeMRpucApc9q2WYfH5RPJkeW49IzYYAulmAhYQScuORkFCWzhGze+6ucre1DHw1hWr8S/c2y4yKFtEZPbapalgNyDjSbXoAvm+qotNKaItYzkoJ7gVLqDsT5yMIU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uHjcYOsk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uHjcYOsk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D323C433C7; Fri, 16 Feb 2024 09:50:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077051; bh=jkU8fzHKVOY3XrQK/o8fGUMEv+lpAbJD1IclMBjSAxs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uHjcYOskMlrX2XSHEtcFyhgpHb3BtEwcC6j+NveJeuAo0MKU5Yoczl+bN2bBseUAw gHHWwTz1HHOzx5umzYVSA1gNULS2iHdAM3Fo+qCUYL8c9bS9Xj8i1ItKXgde8Pb2of PLKbGBEJI1hEid4I6QBl0oomKPfOhGD6S7l3YVZZ7QiJ9WzIBfPbzuhcvXhc9J0oW1 Kw+mniKUdDKXwBTIwGVmI6jFcXOTcP8c70VnMgfs3zBEBEcp7ismP9y9xs7vMmEiYA h92WnoKtA/a+4ppObUd5dq3Rch4RzkIptc1HLdzfFBS1JywAy9EaLSrfqeohTs0hsX X5VidAurPBBfg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 2/7] selftests: mptcp: simult flows: define missing vars Date: Fri, 16 Feb 2024 17:50:30 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang fhe variables 'large', 'small', 'sout', 'cout', 'capout' and 'size' are used in multiple functions, so they should be defined as global variables. This patch redefines them at the beginning of simult_flows.sh. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/simult_flows.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/test= ing/selftests/net/mptcp/simult_flows.sh index 2f5d3c73db5f..e6e5b933a1b9 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -16,6 +16,12 @@ test_cnt=3D1 ret=3D0 bail=3D0 slack=3D50 +large=3D"" +small=3D"" +sout=3D"" +cout=3D"" +capout=3D"" +size=3D0 =20 usage() { echo "Usage: $0 [ -b ] [ -c ] [ -d ]" --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B09E1CD13 for ; Fri, 16 Feb 2024 09:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077053; cv=none; b=YzqhV12L1jJezmon1IFJSD55JS5ZV1SmQk/6pQzX0RSP/FS1Y65agn7C/OVWTNuE0EYs/ljS8chzVZyZ04jjCxkeVD16vLDlYMjZXHzuNzL759zi72nd7eFIz9W66tUCQCt2S3o+tf7kArAwIwXi+HPfnIOoAlFBRZD83xBXU4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077053; c=relaxed/simple; bh=z0NhTB092mg6YDXAk7JdFQ8yb3lDCuESpUqDY2Wge1Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pN7pnIMDyXKieqUinS/FUjjyMVvkqFeGIHtPnHWe/RFXB2xeE8ohy9wG23UdB1sx29YP56opN72XCQnoie94GEg+T93p/diDRdB1v7JTvRNfE4RH9oAa7yQ9EO4oRh7BwKx76oaS+EAIXScQ/dK0C8iVCZ9vZFOuk9enT0zYUJU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n8fS/zbH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n8fS/zbH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF178C433C7; Fri, 16 Feb 2024 09:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077053; bh=z0NhTB092mg6YDXAk7JdFQ8yb3lDCuESpUqDY2Wge1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n8fS/zbHkEg+rM2rP32uiJY4ZRr3Eh0UseF5+lFODVn9vMhR1bYHehYqc5iL+/PqP Fs10YcXWQvkbcWhMm4W4vzLluuIs8kYUx7aawhCVEKuQv4RyPHOuJwLXO59hwCsV7R lTbLObNbnSGXl1A/GMPlREMzGxhOxCrrqx/3MTRpx9/qFFjqLmaxnllavrHKbQL0jt gRVqUiwmKUSMWHtB9AtTQkb4yiJ83frub0cGZGDvM2x8Fm8eGh7KFa2EXDg/Ttuq1E 4LeeDVjtUc8eNfYlvaj41Us8ZHLBuCX++4wnNcOHljUTIOcGZWjTpc9Ta1tZET5tAp NPrETi4cAdRIg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 3/7] selftests: mptcp: join: change capture/checksum as bool Date: Fri, 16 Feb 2024 17:50:31 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang To maintain consistency with other scripts, this patch changes vars 'capture' and 'checksum' as bool vars in mptcp_join. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index b807e2a42c61..88074f64f0a7 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -29,11 +29,11 @@ iptables=3D"iptables" ip6tables=3D"ip6tables" timeout_poll=3D30 timeout_test=3D$((timeout_poll * 2 + 1)) -capture=3D0 -checksum=3D0 +capture=3Dfalse +checksum=3Dfalse ip_mptcp=3D0 check_invert=3D0 -validate_checksum=3D0 +validate_checksum=3Dfalse init=3D0 evts_ns1=3D"" evts_ns2=3D"" @@ -100,7 +100,7 @@ init_partial() ip netns exec $netns sysctl -q net.mptcp.pm_type=3D0 2>/dev/null || true ip netns exec $netns sysctl -q net.ipv4.conf.all.rp_filter=3D0 ip netns exec $netns sysctl -q net.ipv4.conf.default.rp_filter=3D0 - if [ $checksum -eq 1 ]; then + if $checksum; then ip netns exec $netns sysctl -q net.mptcp.checksum_enabled=3D1 fi done @@ -376,7 +376,7 @@ reset_with_checksum() ip netns exec $ns1 sysctl -q net.mptcp.checksum_enabled=3D$ns1_enable ip netns exec $ns2 sysctl -q net.mptcp.checksum_enabled=3D$ns2_enable =20 - validate_checksum=3D1 + validate_checksum=3Dtrue } =20 reset_with_allow_join_id0() @@ -409,7 +409,7 @@ reset_with_allow_join_id0() setup_fail_rules() { check_invert=3D1 - validate_checksum=3D1 + validate_checksum=3Dtrue local i=3D"$1" local ip=3D"${2:-4}" local tables @@ -1013,7 +1013,7 @@ do_transfer() :> "$sout" :> "$capout" =20 - if [ $capture -eq 1 ]; then + if $capture; then local capuser if [ -z $SUDO_USER ] ; then capuser=3D"" @@ -1115,7 +1115,7 @@ do_transfer() wait $spid local rets=3D$? =20 - if [ $capture -eq 1 ]; then + if $capture; then sleep 1 kill $cappid fi @@ -1503,7 +1503,7 @@ chk_join_nr() else print_ok fi - if [ $validate_checksum -eq 1 ]; then + if $validate_checksum; then chk_csum_nr $csum_ns1 $csum_ns2 chk_fail_nr $fail_nr $fail_nr chk_rst_nr $rst_nr $rst_nr @@ -3664,10 +3664,10 @@ while getopts "${all_tests_args}cCih" opt; do tests+=3D("${all_tests[${opt}]}") ;; c) - capture=3D1 + capture=3Dtrue ;; C) - checksum=3D1 + checksum=3Dtrue ;; i) ip_mptcp=3D1 --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9ED01CD1E for ; Fri, 16 Feb 2024 09:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077055; cv=none; b=Cqw7X8pts/kQ+rL4vrpVrRXyr4pt7qLrK/MPIytGMssGf8X1wDU+3dn3a3rSseWnynNPTyE1SuS57mCS/lqtdnBsW6nvrNmjbifs3bik1jsfsSPUdLQlXnsDxIi77zVrPX4QYT00Ftyy2oD0K0lI3St2kGvF7b8EL2PTZ7+yJe0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077055; c=relaxed/simple; bh=cKRbb0c0guvejKW9j5J7luR+8vA4BbBT80H37rwsE5Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fwFnEihXiHbVI/nBq+Q1YwieOedLxeC7qlwrURnwpY3v2XeQrkr/RC6zNSzoeSttrhlZnL6zT7BQJg3XST7OTdYixnTJEHQ9q5edFwWQN0q1euWCaTGQOZ7f20sOvpEPaX16o59AMrOq/AMWBnAKby9g7/i99tKASIoR4UhWlKg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JWTJwWg7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JWTJwWg7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08791C433B1; Fri, 16 Feb 2024 09:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077055; bh=cKRbb0c0guvejKW9j5J7luR+8vA4BbBT80H37rwsE5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JWTJwWg7UamEba2dwLEaEfGJGw/ImeN+r/UhyRACGuh/KW0GaOrBAsnj+JoAS2fIH oFuxug45ZQKB2FeM+sSHs1+H1jKM6jePIcuslCQd6ddWhXTms82eU0H3XKDQD7lec8 xJfinJgcG9KPxWE96NUsqtfifUkNb2VeJ+aeGeERIp1KAOL8/jp7nzf/UNKrCPMtzA 8AU+fTErjJ+CflxysshSSVQ9xKoDoNJVUxNW9SDHkZp5nQe35eJpnGFOZk4l5J8ilF 5pqdmwxVlARILGBfLe51ElWkGujqgwVBC0kD6ABWjfp9+H6ZZdIWl9J3eYhErGSy7C sy/uga4c6QaQQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 4/7] selftests: mptcp: diag: change timeout_poll to 30 Date: Fri, 16 Feb 2024 17:50:32 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Even if it is set to 100ms from the beginning with commit df62f2ec3df6 ("selftests/mptcp: add diag interface tests"), there is no reason not to have it to 30ms like all the other tests. diag.sh is not supposed to be slower than the other ones. To maintain consistency with other scripts, this patch changes it to 30. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/self= tests/net/mptcp/diag.sh index 0a58ebb8b04c..8573326d326a 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -8,7 +8,7 @@ rndh=3D$(printf %x $sec)-$(mktemp -u XXXXXX) ns=3D"ns1-$rndh" ksft_skip=3D4 test_cnt=3D1 -timeout_poll=3D100 +timeout_poll=3D30 timeout_test=3D$((timeout_poll * 2 + 1)) ret=3D0 =20 --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F35151CD17 for ; Fri, 16 Feb 2024 09:50:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077059; cv=none; b=HL+Uf2M2KguDV/HibGn20tpWbCEtfzqzG6S5a3JblKoeEggevf6spODiqms0kCP1BEBPH5Siolf9YCT+u9XVLOdSq9x4yA7nAmrANyNL1KJCyk7OrJ6U/tBgsBBzY7KJQJeCQyFduU7eJkitBLbderFcS9qfI1Kgep7NxdSU+Dc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077059; c=relaxed/simple; bh=WTfB/G7xkDM2vtnB1PUe9rO/fwhj+tNHXyPmLFneab0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DOmcxJ71+SBJm4Hyiambx6NdZKTBc3o8IXBnQAMecPc0xj2vSmr3d4sJl/NXBL43+I87MGPH+iWwiQ5FdT9n81XPfLbRJmDE/FdYpM+m1JHnCya4n7dOkosZoQoRR7htz+GomMNf0a1eG1uxflZ6ar1AXxER8ZJI/OiyD9tYukA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dZ5es1yC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dZ5es1yC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FCF7C433F1; Fri, 16 Feb 2024 09:50:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077058; bh=WTfB/G7xkDM2vtnB1PUe9rO/fwhj+tNHXyPmLFneab0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZ5es1yCADGlCd9/AdT9hI+xhxAXm71W/c+jbqAO4BJYMKztcMBcL/Q5s/NVOzh7p alPHzqGZC+v1N1m8jzHOOdhl9p72yG5PRKWNWrVtDhSmwqR9EE9Djy87vSFqS8NtGQ 5QmRFD3uBgi9/FD7GNHzK2q23Kq37nW3gkuMzSDRDrg+CEaxRBbWDRP/Ce6Qi6m9DR PTE6d98yn2Zdo+79ld4pWVyPO9+R4gbqCv3oCok3KpdWvxic572mZ8AzBR2MKDIdNr U6JwqaDhe7uMNNVLFhV0fsnHvAyalnNwPTo0U95qe4F6v7dNC7NmepXF7a0cZ07T1F fb8OJKHafCOng== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 5/7] selftests: mptcp: drop iptables/ip6tables vars Date: Fri, 16 Feb 2024 17:50:33 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Since iptables-legacy/ip6tables-legacy are dropped in the commit 5b31f0f6f954 ("selftests: mptcp: stop forcing iptables-legacy"), there's no need to use ${iptables}/${ip6tables} variables anymore. This patch drops them, and use iptables/ip6tables directly. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 20 +++++++++---------- .../selftests/net/mptcp/mptcp_sockopt.sh | 16 +++++++-------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 88074f64f0a7..9b35a16a7c8b 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -25,8 +25,6 @@ capout=3D"" ns1=3D"" ns2=3D"" ksft_skip=3D4 -iptables=3D"iptables" -ip6tables=3D"ip6tables" timeout_poll=3D30 timeout_test=3D$((timeout_poll * 2 + 1)) capture=3Dfalse @@ -161,11 +159,11 @@ check_tools() exit $ksft_skip fi =20 - if ! "${iptables}" -V &> /dev/null; then - echo "SKIP: Could not run all tests without ${iptables} tool" + if ! iptables -V &> /dev/null; then + echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip - elif ! "${ip6tables}" -V &> /dev/null; then - echo "SKIP: Could not run all tests without ${ip6tables} tool" + elif ! ip6tables -V &> /dev/null; then + echo "SKIP: Could not run all tests without ip6tables tool" exit $ksft_skip fi } @@ -348,9 +346,9 @@ reset_with_add_addr_timeout() =20 reset "${1}" || return 1 =20 - tables=3D"${iptables}" + tables=3D"iptables" if [ $ip -eq 6 ]; then - tables=3D"${ip6tables}" + tables=3D"ip6tables" fi =20 ip netns exec $ns1 sysctl -q net.mptcp.add_addr_timeout=3D1 @@ -414,9 +412,9 @@ setup_fail_rules() local ip=3D"${2:-4}" local tables =20 - tables=3D"${iptables}" + tables=3D"iptables" if [ $ip -eq 6 ]; then - tables=3D"${ip6tables}" + tables=3D"ip6tables" fi =20 ip netns exec $ns2 $tables \ @@ -475,7 +473,7 @@ reset_with_tcp_filter() local src=3D"${2}" local target=3D"${3}" =20 - if ! ip netns exec "${ns}" ${iptables} \ + if ! ip netns exec "${ns}" iptables \ -A INPUT \ -s "${src}" \ -p tcp \ diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_sockopt.sh index dac8e1fc7143..722b0872f00d 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -11,8 +11,6 @@ cout=3D"" ksft_skip=3D4 timeout_poll=3D30 timeout_test=3D$((timeout_poll * 2 + 1)) -iptables=3D"iptables" -ip6tables=3D"ip6tables" =20 sec=3D$(date +%s) rndh=3D$(printf %x $sec)-$(mktemp -u XXXXXX) @@ -26,7 +24,7 @@ add_mark_rules() local m=3D$2 =20 local t - for t in ${iptables} ${ip6tables}; do + for t in "iptables" "ip6tables"; do # just to debug: check we have multiple subflows connection requests ip netns exec $ns $t -A OUTPUT -p tcp --syn -m mark --mark $m -j ACCEPT =20 @@ -96,11 +94,11 @@ if [ $? -ne 0 ];then exit $ksft_skip fi =20 -if ! "${iptables}" -V &> /dev/null; then - echo "SKIP: Could not run all tests without ${iptables} tool" +if ! iptables -V &> /dev/null; then + echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip -elif ! "${ip6tables}" -V &> /dev/null; then - echo "SKIP: Could not run all tests without ${ip6tables} tool" +elif ! ip6tables -V &> /dev/null; then + echo "SKIP: Could not run all tests without ip6tables tool" exit $ksft_skip fi =20 @@ -109,10 +107,10 @@ check_mark() local ns=3D$1 local af=3D$2 =20 - local tables=3D${iptables} + local tables=3D"iptables" =20 if [ $af -eq 6 ];then - tables=3D${ip6tables} + tables=3D"ip6tables" fi =20 local counters values --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32A981CD1A for ; Fri, 16 Feb 2024 09:51:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077060; cv=none; b=qUb/630RH8yXxhyDuJuLoBsixqt8DuTivbUWFCkzaqJsgeOGbiegQJQUTvCbkgpF7gB5jLfclS4Fjo1B0M8zwyvS9e7tNMksx64FO4u8tW8JndQu5IytPy1kqRKYe9kUESKqVeRPou5dcuvINuotSskKhWo0Zynou5oigwBeGVY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077060; c=relaxed/simple; bh=dk1KkwX+Ty+WG64JuEontnoxsdAzIGSeUoFVGvovSfA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WSEPe5mUN14Bji4WJC1P0tUmMqToJOvm7fXRD1x+UovBXMp/3jb7lva/VSi/q+qk/Z2t5T8gkunsnXuVHnVLX2xmR5qBOxdXqRXr9pUGiKBbVts63iyUUkJwaQv8SxTnKETCFmqUj0nU87KeAzMvVx9VFkuOzYTM8aa3/rloSV0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bG1OuBrm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bG1OuBrm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA9AC433C7; Fri, 16 Feb 2024 09:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077060; bh=dk1KkwX+Ty+WG64JuEontnoxsdAzIGSeUoFVGvovSfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bG1OuBrmEOiDOkbYOhLt8hlsZocGp2twj5kGRUdBSXJ0+EpkjW6cOk8SpPfT+SlSD kXud6zockiElYG64yiQqrVzRWRA4pT2yt7XLcnbxiLq/U6kRUmPYfpcn4epM9Ectqa VcLRYAbajcHZSHX+RKp2Hg3zrOIx2AU+4WYfItJenhWp+kCsSEVWnlKEqSBP40OO1D V4a7SN0WvohIhEL5MKPZESJpzbh62KX+pLTGADZY/Mhoiho2+18+bRon5S13TwLD8R Y9YaBTIkB5ok6F//M0LoroIqv8IkmSPgEoR1J5XvSSzOXKOW0qJsNPW4nzSL/eOW4e Hbz0aNjwK+Fgg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 6/7] selftests: mptcp: add ss mptcp support checks Date: Fri, 16 Feb 2024 17:50:34 +0800 Message-Id: <2d8dc3ee982371cf9fd8a2c050dec0d0bfb34ff7.1708076886.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang Commands 'ss -M' are used in scripts mptcp_connect.sh, mptcp_join.sh, and mptcp_sockopt.sh to display only MPTCP sockets. So it must be checked if ss tool supports MPTCP in these script. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 5 +++++ tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 +++++ tools/testing/selftests/net/mptcp/mptcp_sockopt.sh | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index 7898d62fce0b..eb811d257cab 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -154,6 +154,11 @@ if [ $? -ne 0 ];then exit $ksft_skip fi =20 +if ! ss -h | grep -q MPTCP; then + echo "SKIP: ss tool does not support MPTCP" + exit $ksft_skip +fi + sin=3D$(mktemp) sout=3D$(mktemp) cin=3D$(mktemp) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 9b35a16a7c8b..34a8d5ab185c 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -159,6 +159,11 @@ check_tools() exit $ksft_skip fi =20 + if ! ss -h | grep -q MPTCP; then + echo "SKIP: ss tool does not support MPTCP" + exit $ksft_skip + fi + if ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_sockopt.sh index 722b0872f00d..988042912c7a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -94,6 +94,11 @@ if [ $? -ne 0 ];then exit $ksft_skip fi =20 +if ! ss -h | grep -q MPTCP; then + echo "SKIP: ss tool does not support MPTCP" + exit $ksft_skip +fi + if ! iptables -V &> /dev/null; then echo "SKIP: Could not run all tests without iptables tool" exit $ksft_skip --=20 2.40.1 From nobody Tue May 14 20:16:08 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9D101B812 for ; Fri, 16 Feb 2024 09:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077062; cv=none; b=OY0/UiAj7chO75s3h1DKQZuC1R9ZfsyC5gZfUsvT5IudWjV11nMquTlhg4OuuttsYoAxjgJ6GlbW0ig3wmT7em5pcWjMSETsp401JCxWqlUAM1zkL+odvzTDugV/nxMR2PavZc8gksMrYPCglku05oEcVNV9qJznt4FslB7qCjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708077062; c=relaxed/simple; bh=ztSOL3yuAiBglsCt/oJFcG/XW3eHsvPR15R7sR8PpG8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ErWD26N7rqbhfJY6TLjddV8uTeIvNaq39+sxQb7Gde7xkoJ/Uih8rJkq5ScL2D8EvcH6XvWrJjDtFgQOYQCYC91xBARRs2cEzf0HuCByUI52lPD/W4GI3PJBpJwfr37W7CRgrGRoJGMQy3Q602ipcIghpp8IF1yx7GFW8TUpqlE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WzRMTEz8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WzRMTEz8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18C78C433F1; Fri, 16 Feb 2024 09:51:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708077062; bh=ztSOL3yuAiBglsCt/oJFcG/XW3eHsvPR15R7sR8PpG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzRMTEz8REohS0jGEMk0XVGaYCkodUdyEGHH5M0TJ7KLdquL0H2wABi6D5OLbnwzb ZdVPbd+hNGAbTfOPzICqqOHUj5rri+1RZryLNvcQ3ZR/clwO5jzAShS1fxPc7TjioE yzPmnKlov5wVncUbHa8iZFrp7NuXEDlgr77J8fRJ2vYxuBov/WN9rGVL3iOlVFcjhN UClfWE0aJ6Djvy9hmmeftBDW222z0pOvNB1jw0YfRIxnuPkL1TiPPO3Nl6SQgNM6Cq GhCHHvHwBqppWuyIhpM2KbUp5WEoCDwcDJRi8flayCjjslbq87Aoicf046ppiOIKEQ yU3y2m9QdwxYA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 7/7] selftests: mptcp: add mptcp_lib_check_tools helper Date: Fri, 16 Feb 2024 17:50:35 +0800 Message-Id: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang This patch exports check_tools() helper from mptcp_join.sh into mptcp_lib.sh as a public one mptcp_lib_check_tools(). The arguments "ip", "ss", and "iptables" are passed into this helper to indicate whether to check ip tool, ss tool and iptables tools. This helper can be used in every scripts. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/diag.sh | 13 +-------- .../selftests/net/mptcp/mptcp_connect.sh | 14 +-------- .../testing/selftests/net/mptcp/mptcp_join.sh | 26 +---------------- .../testing/selftests/net/mptcp/mptcp_lib.sh | 29 +++++++++++++++++++ .../selftests/net/mptcp/mptcp_sockopt.sh | 22 +------------- .../testing/selftests/net/mptcp/pm_netlink.sh | 8 +---- .../selftests/net/mptcp/simult_flows.sh | 8 +---- .../selftests/net/mptcp/userspace_pm.sh | 8 +---- 8 files changed, 36 insertions(+), 92 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/diag.sh b/tools/testing/self= tests/net/mptcp/diag.sh index 8573326d326a..7c68160ad3b9 100755 --- a/tools/testing/selftests/net/mptcp/diag.sh +++ b/tools/testing/selftests/net/mptcp/diag.sh @@ -33,18 +33,7 @@ cleanup() ip netns del $ns } =20 -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 -fi -ss -h | grep -q MPTCP -if [ $? -ne 0 ];then - echo "SKIP: ss tool does not support MPTCP" - exit $ksft_skip -fi +mptcp_lib_check_tools "ip" "ss" =20 get_msk_inuse() { diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index eb811d257cab..6c846db4243f 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -145,19 +145,7 @@ cleanup() done } =20 -mptcp_lib_check_mptcp -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 -fi - -if ! ss -h | grep -q MPTCP; then - echo "SKIP: ss tool does not support MPTCP" - exit $ksft_skip -fi +mptcp_lib_check_tools "ip" "ss" =20 sin=3D$(mktemp) sout=3D$(mktemp) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 34a8d5ab185c..644740d7d988 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -149,34 +149,10 @@ cleanup_partial() done } =20 -check_tools() -{ - mptcp_lib_check_mptcp - mptcp_lib_check_kallsyms - - if ! ip -Version &> /dev/null; then - echo "SKIP: Could not run test without ip tool" - exit $ksft_skip - fi - - if ! ss -h | grep -q MPTCP; then - echo "SKIP: ss tool does not support MPTCP" - exit $ksft_skip - fi - - if ! iptables -V &> /dev/null; then - echo "SKIP: Could not run all tests without iptables tool" - exit $ksft_skip - elif ! ip6tables -V &> /dev/null; then - echo "SKIP: Could not run all tests without ip6tables tool" - exit $ksft_skip - fi -} - init() { init=3D1 =20 - check_tools + mptcp_lib_check_tools "ip" "ss" "iptables" =20 sin=3D$(mktemp) sout=3D$(mktemp) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index 108a1e12436c..cdb8948749eb 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -319,3 +319,32 @@ mptcp_lib_wait_local_port_listen() { sleep 0.1 done } + +mptcp_lib_check_tools() { + mptcp_lib_check_mptcp + mptcp_lib_check_kallsyms + + if [ "${1:-""}" =3D=3D "ip" ]; then + if ! ip -Version &> /dev/null; then + mptcp_lib_print_warn "SKIP: Could not run test without ip tool" + exit ${KSFT_SKIP} + fi + fi + + if [ "${2:-""}" =3D=3D "ss" ]; then + if ! ss -h | grep -q MPTCP; then + mptcp_lib_print_warn "SKIP: ss tool does not support MPTCP" + exit ${KSFT_SKIP} + fi + fi + + if [ "${3:-""}" =3D=3D "iptables" ]; then + if ! iptables -V &> /dev/null; then + mptcp_lib_print_warn "SKIP: Could not run all tests without iptables to= ol" + exit ${KSFT_SKIP} + elif ! ip6tables -V &> /dev/null; then + mptcp_lib_print_warn "SKIP: Could not run all tests without ip6tables t= ool" + exit ${KSFT_SKIP} + fi + fi +} diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_sockopt.sh index 988042912c7a..8b6dd6e919c8 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.sh @@ -85,27 +85,7 @@ cleanup() rm -f "$sin" "$sout" } =20 -mptcp_lib_check_mptcp -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 -fi - -if ! ss -h | grep -q MPTCP; then - echo "SKIP: ss tool does not support MPTCP" - exit $ksft_skip -fi - -if ! iptables -V &> /dev/null; then - echo "SKIP: Could not run all tests without iptables tool" - exit $ksft_skip -elif ! ip6tables -V &> /dev/null; then - echo "SKIP: Could not run all tests without ip6tables tool" - exit $ksft_skip -fi +mptcp_lib_check_tools "ip" "ss" "iptables" =20 check_mark() { diff --git a/tools/testing/selftests/net/mptcp/pm_netlink.sh b/tools/testin= g/selftests/net/mptcp/pm_netlink.sh index ebfefae71e13..e7ab5eca3e75 100755 --- a/tools/testing/selftests/net/mptcp/pm_netlink.sh +++ b/tools/testing/selftests/net/mptcp/pm_netlink.sh @@ -35,13 +35,7 @@ cleanup() ip netns del $ns1 } =20 -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 -fi +mptcp_lib_check_tools "ip" =20 trap cleanup EXIT =20 diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/test= ing/selftests/net/mptcp/simult_flows.sh index e6e5b933a1b9..053f40bf25c1 100755 --- a/tools/testing/selftests/net/mptcp/simult_flows.sh +++ b/tools/testing/selftests/net/mptcp/simult_flows.sh @@ -42,13 +42,7 @@ cleanup() done } =20 -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 -fi +mptcp_lib_check_tools "ip" =20 # "$ns1" ns2 ns3 # ns1eth1 ns2eth1 ns2eth3 ns3eth1 diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/test= ing/selftests/net/mptcp/userspace_pm.sh index 1b94a75604fe..9d42fb9bc809 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -10,19 +10,13 @@ =20 . "$(dirname "${0}")/mptcp_lib.sh" =20 -mptcp_lib_check_mptcp -mptcp_lib_check_kallsyms +mptcp_lib_check_tools "ip" =20 if ! mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then echo "userspace pm tests are not supported by the kernel: SKIP" exit ${KSFT_SKIP} fi =20 -if ! ip -Version &> /dev/null; then - echo "SKIP: Cannot not run test without ip tool" - exit ${KSFT_SKIP} -fi - ANNOUNCED=3D6 # MPTCP_EVENT_ANNOUNCED REMOVED=3D7 # MPTCP_EVENT_REMOVED SUB_ESTABLISHED=3D10 # MPTCP_EVENT_SUB_ESTABLISHED --=20 2.40.1