From nobody Thu Dec 5 02:40:21 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 B2DD21E4A4 for ; Fri, 8 Mar 2024 05:57: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=1709877473; cv=none; b=MH1dcpBv4SzFpEmM2LImzwnshwBoQS9qC5s6Ukn9nTIa3nsqMuoxl7FdoxGcjWe2IeLN8JElXgU6N0aUfcCuD48PMQxdtbgEmh8EanOUa3Nuduitp2GzemCDs4flGD82q6vMMxh/4zMaZum8H0/cXpGuUnGvju1eVePwQhzyJWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709877473; c=relaxed/simple; bh=8dyLYRWHnpeNesunCPEBQgcjDgxjnWitLLRu72WpwiI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g8H7kVGxG5f5/e3+vQ3ig7Zptbrbuq8StWxnTXVQZWVfba4ct1pyK1GRU0fr6eMjkkzHWBzrN9NPgWpWglQF/SQrV+CjgU6X+jW1ER8+hQDD0m3CB+HWnAV87jHAGSZzc2D6YwENvTTFzvdIJCfdyqwqSsXPaS9Sz4YQlHTKu7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QvWVwzZQ; 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="QvWVwzZQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3CF0C433F1; Fri, 8 Mar 2024 05:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709877473; bh=8dyLYRWHnpeNesunCPEBQgcjDgxjnWitLLRu72WpwiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QvWVwzZQLRYr1gGeqGwcu3oUFptQbpltJBZuO8jEsi7DG96/SfucWWymBDnncRYft z3c3EFOf99LsMVVaKK1OGNmFdKiiv/Z29o6/yp7DIgoM6aY2kVKTqPca7IFZcPBg4G 7wAzNZbVsOhU2CofZWBSTpCrSCO94m8FjV+ppXNz16cs50+cvtAVP3GaFCk1WZAZ11 g/2Z3yhPZeVyqajtF0/lZCIQa/292g4z+q4IqLZx85orBcvj6Xu/BDf3jpwuYW3Tkw mHJSFyJSz421hhltLjB+RChYi2xeKV9hKmg+l9eSWVDzlTH53D43z/s5/P88MW0inG xn6Q1BHfNvZow== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v2 7/7] selftests: mptcp: join: use += operator to append strings Date: Fri, 8 Mar 2024 13:57:40 +0800 Message-Id: <1cbccb38bedfa1f606d0fd71ca992bc569f4cea5.1709876991.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 This patch uses addition assignment operator (+=3D) to append strings inste= ad of open-coding in mptcp_join.sh. This can make the statements shorter. Signed-off-by: Geliang Tang --- .../testing/selftests/net/mptcp/mptcp_join.sh | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 140d80289b51..5e9211e89825 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -755,18 +755,18 @@ pm_nl_check_endpoint() line=3D"${line% }" # the dump order is: address id flags port dev [ -n "$addr" ] && expected_line=3D"$addr" - expected_line=3D"$expected_line $id" - [ -n "$_flags" ] && expected_line=3D"$expected_line ${_flags//","/" "}" - [ -n "$dev" ] && expected_line=3D"$expected_line $dev" - [ -n "$port" ] && expected_line=3D"$expected_line $port" + expected_line+=3D" $id" + [ -n "$_flags" ] && expected_line+=3D" ${_flags//","/" "}" + [ -n "$dev" ] && expected_line+=3D" $dev" + [ -n "$port" ] && expected_line+=3D" $port" else line=3D$(ip netns exec $ns ./pm_nl_ctl get $_id) # the dump order is: id flags dev address port expected_line=3D"$id" - [ -n "$flags" ] && expected_line=3D"$expected_line $flags" - [ -n "$dev" ] && expected_line=3D"$expected_line $dev" - [ -n "$addr" ] && expected_line=3D"$expected_line $addr" - [ -n "$_port" ] && expected_line=3D"$expected_line $_port" + [ -n "$flags" ] && expected_line+=3D" $flags" + [ -n "$dev" ] && expected_line+=3D" $dev" + [ -n "$addr" ] && expected_line+=3D" $addr" + [ -n "$_port" ] && expected_line+=3D" $_port" fi if [ "$line" =3D "$expected_line" ]; then print_ok @@ -1217,7 +1217,7 @@ chk_csum_nr() print_check "sum" count=3D$(mptcp_lib_get_counter ${ns1} "MPTcpExtDataCsumErr") if [ "$count" !=3D "$csum_ns1" ]; then - extra_msg=3D"$extra_msg ns1=3D$count" + extra_msg+=3D" ns1=3D$count" fi if [ -z "$count" ]; then print_skip @@ -1230,7 +1230,7 @@ chk_csum_nr() print_check "csum" count=3D$(mptcp_lib_get_counter ${ns2} "MPTcpExtDataCsumErr") if [ "$count" !=3D "$csum_ns2" ]; then - extra_msg=3D"$extra_msg ns2=3D$count" + extra_msg+=3D" ns2=3D$count" fi if [ -z "$count" ]; then print_skip @@ -1274,7 +1274,7 @@ chk_fail_nr() print_check "ftx" count=3D$(mptcp_lib_get_counter ${ns_tx} "MPTcpExtMPFailTx") if [ "$count" !=3D "$fail_tx" ]; then - extra_msg=3D"$extra_msg,tx=3D$count" + extra_msg+=3D",tx=3D$count" fi if [ -z "$count" ]; then print_skip @@ -1288,7 +1288,7 @@ chk_fail_nr() print_check "failrx" count=3D$(mptcp_lib_get_counter ${ns_rx} "MPTcpExtMPFailRx") if [ "$count" !=3D "$fail_rx" ]; then - extra_msg=3D"$extra_msg,rx=3D$count" + extra_msg+=3D",rx=3D$count" fi if [ -z "$count" ]; then print_skip @@ -1323,7 +1323,7 @@ chk_fclose_nr() if [ -z "$count" ]; then print_skip elif [ "$count" !=3D "$fclose_tx" ]; then - extra_msg=3D"$extra_msg,tx=3D$count" + extra_msg+=3D",tx=3D$count" fail_test "got $count MP_FASTCLOSE[s] TX expected $fclose_tx" else print_ok @@ -1334,7 +1334,7 @@ chk_fclose_nr() if [ -z "$count" ]; then print_skip elif [ "$count" !=3D "$fclose_rx" ]; then - extra_msg=3D"$extra_msg,rx=3D$count" + extra_msg+=3D",rx=3D$count" fail_test "got $count MP_FASTCLOSE[s] RX expected $fclose_rx" else print_ok @@ -1703,7 +1703,7 @@ chk_rm_nr() count=3D$((count + cnt)) if [ "$count" !=3D "$rm_subflow_nr" ]; then suffix=3D"$count in [$rm_subflow_nr:$((rm_subflow_nr*2))]" - extra_msg=3D"$extra_msg simult" + extra_msg+=3D" simult" fi if [ $count -ge "$rm_subflow_nr" ] && \ [ "$count" -le "$((rm_subflow_nr *2 ))" ]; then --=20 2.40.1