From nobody Mon Sep 16 19:47:25 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 A9D212574F for ; Fri, 24 May 2024 03:11:57 +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=1716520317; cv=none; b=Ncplkqx0F+wt9MUOhDykeGgk4anaK8osdOWH71KZXAO6uFC7v7NlExFDMDQkYvhz9Ee6FFvN9UwGFCwB2TlClH08CSRCFua8C9VUz9FE0WRC6WjkkKFISQDZ637L51+FuqlkkzZQB1guawqI3GZt+R2F4B02IEc2CHCsv6pbw+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716520317; c=relaxed/simple; bh=bR6pK/1fSnwooVIbPtC3vMYoplbNJ37RZGfgJ3ff+48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uFlr+9fHQJxEENp9v1k915gPvKfydhYxRPNmVLMz+rSZGp/4gj/tunAwy20j0aEve+vLbuWkiLEIfJptbTiqhw8VgtIpKB1DpUDmSNOfBmJxhlg8uzN+7QYoBRhYC8BvWWvG8lR0W159q458ZEvPwVarOmScvO8NSpztcvvhKDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Fl8oaC2W; 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="Fl8oaC2W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6F2EC32786; Fri, 24 May 2024 03:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716520317; bh=bR6pK/1fSnwooVIbPtC3vMYoplbNJ37RZGfgJ3ff+48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fl8oaC2WCfeO8kuE6CfwrzF1OyRAQxy6Ph2Ygnjy4Mg3ZMnJDux837V5GSCw34fP0 kun65/R/RyxVmBdGUG9YGr43KH5niWNh1+4Eh7V8dAz0dr2LOu+PCObHF/7gMCl/TS wpokE43g68glRsn0sptkGsz+Hc3DVdzQ0Sq4HmPHp2YSoeHJt7fJtIJCGUSFTvBDsj 8z/doXKQZqQI8RNHSmZX1BW8nA7pVy5dd5rQO1+CTyXQhp7iybTGsSwadv3q9CnUlM gck4lGeClZqi9g/cWafoTS/vD45Zw4nn0Q7UplFhBEqVYKO6HMn6DXZc5JqYOW+IZH lkFo6NYPCeWkQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v3 1/4] selftests: net: rename ns in setup/cleanup_ns Date: Fri, 24 May 2024 11:11:46 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 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 helpers setup_ns and cleanup_ns don't work when a namespace named "ns" is passed to them. For example, in net/mptcp/diag.sh, the name of the namespace is "ns". If "setup_ns ns" is used in it, diag.sh fails with errors: Invalid netns name "./mptcp_connect" Cannot open network namespace "10000": No such file or directory Cannot open network namespace "10000": No such file or directory That is because "ns" is also a local variable in both setup_ns and cleanup_ns. To solve this, this patch renames the local variable "ns" as "_ns". Also a ns_name valid check has been added to setup_ns. If "_ns" is passed in as a ns_name, setup_ns helper exits. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/lib.sh | 33 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/net/lib.sh b/tools/testing/selftests/n= et/lib.sh index edc030e81a46..1401f5bf961a 100644 --- a/tools/testing/selftests/net/lib.sh +++ b/tools/testing/selftests/net/lib.sh @@ -128,7 +128,7 @@ slowwait_for_counter() =20 cleanup_ns() { - local ns=3D"" + local _ns=3D"" local errexit=3D0 local ret=3D0 =20 @@ -138,10 +138,11 @@ cleanup_ns() set +e fi =20 - for ns in "$@"; do - ip netns delete "${ns}" &> /dev/null - if ! busywait $BUSYWAIT_TIMEOUT ip netns list \| grep -vq "^$ns$" &> /de= v/null; then - echo "Warn: Failed to remove namespace $ns" + for _ns in "$@"; do + ip netns delete "${_ns}" &> /dev/null + if ! busywait $BUSYWAIT_TIMEOUT ip netns list \ + \| grep -vq "^$_ns$" &> /dev/null; then + echo "Warn: Failed to remove namespace $_ns" ret=3D1 fi done @@ -159,29 +160,35 @@ cleanup_all_ns() # setup_ns local remote setup_ns() { - local ns=3D"" + local _ns=3D"" local ns_name=3D"" local ns_list=3D"" local ns_exist=3D for ns_name in "$@"; do + if [ "${ns_name}" =3D=3D "_ns" ]; then + echo "ns_name shouldn't be _ns" + cleanup_ns "$ns_list" + set -e + return $ksft_fail + fi # Some test may setup/remove same netns multi times if unset ${ns_name} 2> /dev/null; then - ns=3D"${ns_name,,}-$(mktemp -u XXXXXX)" - eval readonly ${ns_name}=3D"$ns" + _ns=3D"${ns_name,,}-$(mktemp -u XXXXXX)" + eval readonly ${ns_name}=3D"$_ns" ns_exist=3Dfalse else - eval ns=3D'$'${ns_name} - cleanup_ns "$ns" + eval _ns=3D'$'${ns_name} + cleanup_ns "$_ns" ns_exist=3Dtrue fi =20 - if ! ip netns add "$ns"; then + if ! ip netns add "$_ns"; then echo "Failed to create namespace $ns_name" cleanup_ns "$ns_list" return $ksft_skip fi - ip -n "$ns" link set lo up - ! $ns_exist && ns_list=3D"$ns_list $ns" + ip -n "$_ns" link set lo up + ! $ns_exist && ns_list=3D"$ns_list $_ns" done NS_LIST=3D"$NS_LIST $ns_list" } --=20 2.43.0 From nobody Mon Sep 16 19:47:25 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 683792D60C for ; Fri, 24 May 2024 03:11: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=1716520319; cv=none; b=Ngdc0ya+Era0CTtTo2DUgr6aA1LyDu5q1WITR6sUYHmq/sDGeQQgNMZyaI3zcG/xhs27uIej7tC7fNTkrave0wHsQt/hsDd5Yfqy1/4s4OWTfEpdzUqseGEqBDYWudAu5Eg23PZ5pkNcrJlv1Nt7JMZ7B/A5rjXwstnaTgKGLuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716520319; c=relaxed/simple; bh=G1zdUXQnjhKWktScdIwlRJiKgpfmFt8uQbBKK3oanzI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cIkcJ5UjuzyOye1kCVBN1Jd8J6ztTk028e1UVwnMgB/jhgntvb62X73QgSzBIoYUyBBrhVrt9GY1b2DZ2IMGyLw5z7m4hsD76KayCGjLgnpkSqITlqrpwfE/UjxdHiTeMqypTqelXTZAj/6pxagTGCxS3hnuvB9prsOxG86WYbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vRLTIwXZ; 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="vRLTIwXZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C090C32781; Fri, 24 May 2024 03:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716520318; bh=G1zdUXQnjhKWktScdIwlRJiKgpfmFt8uQbBKK3oanzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vRLTIwXZk8V6rMRi6pZYpTM2n3iagM4+IH8bYu70x7Q29Q7mqME0At5mRe4LOBx0i wL5bF/pOoO9DvIjn6HyA/mGpsm0ASvv/m8Jw2rmQ/fnZyqStcZsBsPZK6ujAtS14I6 LxsuNmSeXZPGJIvsfKQooUe1GqBLXUbevjc4wEJn9IvwlRzV1MHEzsH5cR8ozj0uv6 uBfwmIF28iqJ80ueGkYlKn+Kw02Vcs6mHQlvYQsz1KCfNIWPkSUrtzUUWeasroUdIu ckYuyyIvkP1tCJTojRM2betFKeePM0Z7qh8XbWvJvPZrbvHPR09/QFouBSTVD8bX7R Rl8TuEsfWqnKw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v3 2/4] selftests: mptcp: rename ns to _ns in get_counter Date: Fri, 24 May 2024 11:11:47 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 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 If "setup_ns ns" is used in diag.sh, it fails with errors: ./mptcp_lib.sh: line 289: local: ns: readonly variable 13 ....chk 2 cestab [ OK ] 14 ....chk 2->0 msk in use after flush [ OK ] That is because "ns" is also a local variable in mptcp_lib_get_counter. To solve this, this patch renames it as "_ns". Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index ad2ebda5cb64..16aa080c8229 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -286,11 +286,11 @@ mptcp_lib_is_v6() { =20 # $1: ns, $2: MIB counter mptcp_lib_get_counter() { - local ns=3D"${1}" + local _ns=3D"${1}" local counter=3D"${2}" local count =20 - count=3D$(ip netns exec "${ns}" nstat -asz "${counter}" | + count=3D$(ip netns exec "${_ns}" nstat -asz "${counter}" | awk 'NR=3D=3D1 {next} {print $2}') if [ -z "${count}" ]; then mptcp_lib_fail_if_expected_feature "${counter} counter" --=20 2.43.0 From nobody Mon Sep 16 19:47:25 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 597FD2574F for ; Fri, 24 May 2024 03:12: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=1716520320; cv=none; b=B+k5yUJIeBInS07hK/Q2YavRvdVBv0Tp/czo5iA//FaOS+cQ5PjQlZdhS9yEZE4uwM0csg46ziqh8EUlkA7corLt+F7Ckn544l1p/8/x+7bfVV/deewneFSG+S7qOTZSmWYSklk6j0ZD5vgdlIhdwPiR+8Y6ZVR/FmODC3mjAJc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716520320; c=relaxed/simple; bh=G4KLd7hvM8wQ8n1ZPUkb6ONEZe3Uhg7XFWmWGo7OK/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jG7OpQfRnfGlUFQcPR73m0i8ZA32L5+QYppuwPAcT3RCBhXF4jxdF2q52LQDk4ykJuSGnaWyls6hQQ5hn1xfdTHRDKzNqx2wy1D31AveL0PIs/qSmDa5me0RE99guV0tJ2vqckAE6OpKMzTNe29rx7Omhw7Y8gPuVcuk4A3nF9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EWEvnSBy; 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="EWEvnSBy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DB77C2BD10; Fri, 24 May 2024 03:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716520320; bh=G4KLd7hvM8wQ8n1ZPUkb6ONEZe3Uhg7XFWmWGo7OK/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EWEvnSByHxFRssaAVm/OIV+6oTikRaXefCvUqM7Vi7ohfpxTaUxBU340I82Km8FFt 6MmV/LEQSi7Mw9+aIm2OzNVXavnCMTq2Dmv5yQNp5jdvpl3BJNqdgLozTuxclNb0pV gs1kEAvzYOb28RgSZ2uPFhrXX/cjZRjc4FyVeLiLDppOcxbpZ9U1Ic44UUG3wVzTAl fiOClKG8987fz2hm3mi/Tf5EJlBvwvZpUirPKzqRHLobew4m1ADPKBThigToJLDu3g +7neRQcy9UKi2iHOiUqfUwMv4MHlR319NLLjTxlcVRV513X/z8J3QdWKQGmNlfRsjn OFm+/pdkGXUqg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v3 3/4] selftests: mptcp: use setup/cleanup_ns helpers Date: Fri, 24 May 2024 11:11:48 +0800 Message-ID: <7587b0110e680acd1cd7a48dcbea9542c05090db.1716519897.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 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 includes lib.sh into mptcp_lib.sh, uses setup_ns helper defined in lib.sh to set up namespaces in mptcp_lib_ns_init(), and uses cleanup_ns to delete namespaces in mptcp_lib_ns_exit(). Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index 16aa080c8229..642a0ee255ef 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -1,6 +1,8 @@ #! /bin/bash # SPDX-License-Identifier: GPL-2.0 =20 +. "$(dirname "${0}")/../lib.sh" + readonly KSFT_PASS=3D0 readonly KSFT_FAIL=3D1 readonly KSFT_SKIP=3D4 @@ -412,17 +414,10 @@ mptcp_lib_check_tools() { } =20 mptcp_lib_ns_init() { - local sec rndh - - sec=3D$(date +%s) - rndh=3D$(printf %x "${sec}")-$(mktemp -u XXXXXX) + setup_ns "${@}" =20 local netns for netns in "${@}"; do - eval "${netns}=3D${netns}-${rndh}" - - ip netns add "${!netns}" || exit ${KSFT_SKIP} - ip -net "${!netns}" link set lo up ip netns exec "${!netns}" sysctl -q net.mptcp.enabled=3D1 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 @@ -430,9 +425,10 @@ mptcp_lib_ns_init() { } =20 mptcp_lib_ns_exit() { + cleanup_ns "${@}" + local netns for netns in "${@}"; do - ip netns del "${netns}" rm -f /tmp/"${netns}".{nstat,out} done } --=20 2.43.0 From nobody Mon Sep 16 19:47:25 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 AE0D12574F for ; Fri, 24 May 2024 03:12:01 +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=1716520321; cv=none; b=eCuoUwubB8xvnxV2uO5jrrqnILB85DEs9oyuTJf0cp+zFMjv8SjYobdWV8XWBhulOYe06b1KtpVU4notzhs3WzMhjvWVvRJTkKsHMXpYe69SaSvbRvrXdnxxZNLZ71zs37Pd/OQAejIJ9+bFzpNOhXXt40OKSIiC3TRmEUK8hjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716520321; c=relaxed/simple; bh=Vcgn2BAbTqilbdGhBI6353MWKisq1Q2p9sG7JojfT/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PnFp881KR32Gno/2YU3DL7JbYvGHdfQUdGJ3XndgLnD4nSNmdoYvJ1U/dgYLZ9R00781Ful79OcFa5PvpJjSsuDrKh9On0Vr6NaoH7Uo6N4QRpm8nYbPTHgY5vDw8ap/nGYQFCG0Edvw/k0hrwIqq8f/O0/xQrSV9jWvIHAhLOM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jpD9Arwp; 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="jpD9Arwp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1CCAC2BD10; Fri, 24 May 2024 03:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716520321; bh=Vcgn2BAbTqilbdGhBI6353MWKisq1Q2p9sG7JojfT/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jpD9ArwpL2umG+A5Vf7WXhj7OK0xUT3sA/8xHkPG8EB1Q+WS8ZtixFcevQV5l70Uf m2pc7N6yIhxmuN9DxtjdBN3OTCZKLl90cDziYgqeiMm+J72pMpF0YZYGDGxYecHEoJ jt8B/4ty1jNaH2ZjsUsE+Pw8GeaBN2qFKT8S3fkRkvrzdMkAqQ2eDpN6q6aVbzgV+/ P3L/c9IAXbabp2tafv2gt1zrOM8quW4lyJORfh+i7AVxQKnRLXA7sWVywAomGB0kkj pLxd3H3CDl6P+dZMgzwoIcU3Ch8/yXrR7YSuxkzietBgSpx2t5312O6vS2YMSNnHfk 1ufx3+Fd3yvqw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v3 4/4] selftests: mptcp: use wait_local_port_listen helper Date: Fri, 24 May 2024 11:11:49 +0800 Message-ID: <096673dbaaf23c75fbcbb93b602e4e7fc08646d7.1716519897.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 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 includes net_helper.sh into mptcp_lib.sh, uses the helper wait_local_port_listen() defined in it to implement the similar mptcp helper. This can drop some duplicate code. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_lib.sh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_lib.sh b/tools/testing= /selftests/net/mptcp/mptcp_lib.sh index 642a0ee255ef..5ccb302e3fd2 100644 --- a/tools/testing/selftests/net/mptcp/mptcp_lib.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_lib.sh @@ -2,6 +2,7 @@ # SPDX-License-Identifier: GPL-2.0 =20 . "$(dirname "${0}")/../lib.sh" +. "$(dirname "${0}")/../net_helper.sh" =20 readonly KSFT_PASS=3D0 readonly KSFT_FAIL=3D1 @@ -337,20 +338,7 @@ mptcp_lib_check_transfer() { =20 # $1: ns, $2: port mptcp_lib_wait_local_port_listen() { - local listener_ns=3D"${1}" - local port=3D"${2}" - - local port_hex - port_hex=3D"$(printf "%04X" "${port}")" - - local _ - for _ in $(seq 10); do - ip netns exec "${listener_ns}" cat /proc/net/tcp* | \ - awk "BEGIN {rc=3D1} {if (\$2 ~ /:${port_hex}\$/ && \$4 ~ /0A/) \ - {rc=3D0; exit}} END {exit rc}" && - break - sleep 0.1 - done + wait_local_port_listen "${@}" "tcp" } =20 mptcp_lib_check_output() { --=20 2.43.0