From nobody Mon Feb 9 16:47:06 2026 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 5623810A1B for ; Tue, 5 Mar 2024 05:22:17 +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=1709616138; cv=none; b=GtEySVQIqGnNrIKZKCcrwvLmb2zWztZziLDjpEjJZVPqFS7Lafbut47cG9INgxlH9FhiHU3VM/ozi4ZRg5GUIRJRSXCsoxhNY7e2G/Tklza85Sam46QKzg0n9xMEtUuGmYTS6oNa9cJvP8FX0skgwE9KLEKe/DvAu5oA5aAh5CI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709616138; c=relaxed/simple; bh=r2pIfJgq0ihDAIcnTI4H5W5MoR3cRgq2gzhAw956buo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=b/A29aXqUE09h06uxaMcUD/Og91B3DBZ6xqhx1tlfVS6+twMH+cQum/Mhx9UM8Cx34M7RtVnqdO6Pk+RZB8BTFs8z3zla9BEJFX8hcFBPLFVr8fHB35ncLkNsisurShuGDvtVIDSfl2jZ/6mSVsvxKbQ1wm3YLmE3TA+JTefu2I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bxMO1tgN; 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="bxMO1tgN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BBB7C433F1; Tue, 5 Mar 2024 05:22:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709616137; bh=r2pIfJgq0ihDAIcnTI4H5W5MoR3cRgq2gzhAw956buo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bxMO1tgNG0treFWrtRrr0r6vKhtSknZDkfAmVlJ7mQLJt6w6UtjAZrVY7TbyCKkpN +HDzegdbxP0dNHNXweZ9E73FFIKV9MY1jzkD0yz1JD+4TiZXcPMKZHjIl/rFnNA5IY bJOAJD+llxC4T79hQLsBZD9VF6gO0Xiz4uabJAyz8rFX0HUDuv3AtSnOsmB51+kMuz xKD4ZR8nLMQUVTPER5lV3lM5QWYXnqCmasnIUC0RQsA/uBP2+IwEloBv6ZJuk9z+RV UQk2E0zZa51PxOwSAmBrZx8IYY0xDqlaZ8Tw361Gy62JBZZUkgfeRm06darVwEhFoh wdsqD8FI5W94A== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v12 3/9] selftests: mptcp: connect: fix misaligned output Date: Tue, 5 Mar 2024 13:22:01 +0800 Message-Id: <7cabbfad0867d61cc74b5eb86d559c90dc3e7a6b.1709615883.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 first [ OK ] in the output of mptcp_connect.sh misaligns with the others: New MPTCP socket can be blocked via sysctl [ OK ] INFO: validating network environment with pings INFO: Using loss of 0.85% delay 16 ms reorder 95% 70% with delay 4ms on ns1 MPTCP -> ns1 (10.0.1.1:10000 ) MPTCP (duration 184ms) [ OK ] ns1 MPTCP -> ns1 (10.0.1.1:10001 ) TCP (duration 50ms) [ OK ] ns1 TCP -> ns1 (10.0.1.1:10002 ) MPTCP (duration 55ms) [ OK ] This patch aligns them by using 69 chars to display the first two lines, and 50 chars for the other. Since 19 chars are used to display duration time. Also print out a [ OK ] at the end of the 2nd line for consistency. Signed-off-by: Geliang Tang --- tools/testing/selftests/net/mptcp/mptcp_connect.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/tes= ting/selftests/net/mptcp/mptcp_connect.sh index c47ea779145d..709233ffa305 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -248,11 +248,17 @@ else set_ethtool_flags "$ns4" ns4eth3 "$ethtool_args" fi =20 +print_larger_title() { + # here we don't have the time, a bit longer for the alignment + printf "%-69s" "${@}" +} + check_mptcp_disabled() { local disabled_ns mptcp_lib_ns_init disabled_ns =20 + print_larger_title "New MPTCP socket can be blocked via sysctl" # net.mptcp.enabled should be enabled by default if [ "$(ip netns exec ${disabled_ns} sysctl net.mptcp.enabled | awk '{ pr= int $3 }')" -ne 1 ]; then echo -e "net.mptcp.enabled sysctl is not 1 by default\t\t[ FAIL ]" @@ -274,7 +280,7 @@ check_mptcp_disabled() return 1 fi =20 - echo -e "New MPTCP socket can be blocked via sysctl\t\t[ OK ]" + echo "[ OK ]" mptcp_lib_result_pass "New MPTCP socket can be blocked via sysctl" return 0 } @@ -343,7 +349,7 @@ do_transfer() addr_port=3D$(printf "%s:%d" ${connect_addr} ${port}) local result_msg result_msg=3D"$(printf "%.3s %-5s -> %.3s (%-20s) %-5s" ${connector_ns} $= {cl_proto} ${listener_ns} ${addr_port} ${srv_proto})" - printf "%s\t" "${result_msg}" + printf "%-50s" "${result_msg}" =20 if $capture; then local capuser @@ -836,7 +842,7 @@ check_mptcp_disabled =20 stop_if_error "The kernel configuration is not valid for MPTCP" =20 -echo "INFO: validating network environment with pings" +print_larger_title "Validating network environment with pings" for sender in "$ns1" "$ns2" "$ns3" "$ns4";do do_ping "$ns1" $sender 10.0.1.1 do_ping "$ns1" $sender dead:beef:1::1 @@ -858,6 +864,7 @@ done mptcp_lib_result_code "${ret}" "ping tests" =20 stop_if_error "Could not even run ping tests" +echo "[ OK ]" =20 [ -n "$tc_loss" ] && tc -net "$ns2" qdisc add dev ns2eth3 root netem loss = random $tc_loss delay ${tc_delay}ms echo -n "INFO: Using loss of $tc_loss " --=20 2.40.1