From nobody Tue Feb 10 04:53:56 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:bd2:0:0:0:0 with SMTP id g18csp668417jad; Thu, 17 Feb 2022 09:43:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbz/bevoO2Xk3KGe6M6j9OOlEZbka8U/G3mjjqKOVNyngCG3DiH0hLSLCBW9RfBKK/dh0m X-Received: by 2002:a37:a347:0:b0:47f:3a7a:40d0 with SMTP id m68-20020a37a347000000b0047f3a7a40d0mr2335813qke.746.1645119839181; Thu, 17 Feb 2022 09:43:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645119839; cv=none; d=google.com; s=arc-20160816; b=UiwUPtFTa4vvIR7mKRqopN9ZhSiKttY3OcTq8cLXED3MTUGdgpjno2OM3y1Wp7r1wc jZQ0gfW0iboEl6FWy5Wqid1duWEcQPabbg3rSVVHPLlr4JWVYVrYYiivuyJRXw0Kf4Qz z2imvEPMmGLTRECGBryq25lEehEQqwnhhRm5tAdNB5CGLhLMqK/hy3Xh57dxe9TQuYPJ eBUkYNjuKPLg4jadf1fCivDolI3qhVdiogdkJ/LvHGMPNbAPIlFysZ+tUxBkBcRCZ3HU hWci5M2KNCH8WCoKNItJVHo0Rc/lUxF17LmeRhaj5Nd7FcP+c3/7Qwma1U+Glyb9NNsm qbHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+adziSvF41I6atlt1Z2ldiJMMCyHoUkso8xyREXLgOc=; b=kiCKbb+x7sXR1b8CTdFMREDTtAQW7VO8K8fHrB7VLk0giPTYvRzdiBMpaNYpD1c6jT T4lFvpB4SV+iu+2yI+cKhLhKxtsEYICucgoDiS8V+GiAmRMt2E6xxnVsINO/1ja9I8xo c5rDrq1/8uQSswG9iewUS3oHH2czVSidu4OhAQfeqLylwdMUNVcAHIGiiBymU5tw3fWq TXJcRR4ywhBsvTiWWM6ZSsInnm6u09zaOIjofmGkbCTAM7iqZ9/7L6502sB58nL3YuQq Rw+slAmVkB+pvjRGXBn8zUiP4gCOLEV3Rja5WOYErLi1KYGAgQP35XmztBloMbi8vuHQ MDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=BoxMJnSF; spf=pass (google.com: domain of mptcp+bounces-3812-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3812-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id p14si4361308qtk.103.2022.02.17.09.43.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Feb 2022 09:43:59 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3812-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=BoxMJnSF; spf=pass (google.com: domain of mptcp+bounces-3812-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3812-wpasupplicant.patchew=gmail.com@lists.linux.dev" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ewr.edge.kernel.org (Postfix) with ESMTPS id E6D421C0EF3 for ; Thu, 17 Feb 2022 17:43:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 499AA436A; Thu, 17 Feb 2022 17:43:56 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 859C5436C for ; Thu, 17 Feb 2022 17:43:54 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id o24so10362200wro.3 for ; Thu, 17 Feb 2022 09:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares-net.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+adziSvF41I6atlt1Z2ldiJMMCyHoUkso8xyREXLgOc=; b=BoxMJnSFuuqCFNPisgtaAOjFsLFDwjJ92FgRrj5x98M+Wog7/6Uu3AxF3ulC0dfBdL 0JB369mXwn3kxelhKH+EsPuxnL68H5Zy+FB8Tz8IjgIPMs/NQ5GTIj9ly4ZhVHuVKmsR ABHjB+cJbUYJvCZEgE+uPjILhI9N7LKdFSl7uBhGQCGmJW1449ushlv+3Xms+58WW9lQ uZhlTZ4Ia8Psl55c2KM7ga8jPQD21iEF8VtayS2JszFnYBZqZC+PzxARhKWQlZflYCSd ihTg79Gzd9us/EtMucaqc9nuT8uoda2g7Vkt/+M2/x37MWw3PLVL8RMTwyr7c8Xuhcb/ Helg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+adziSvF41I6atlt1Z2ldiJMMCyHoUkso8xyREXLgOc=; b=RSREjAdMpPCwBICU7o2FUOGinxyeftBJRe4xYH9UXjOkaNE915ML/gHjaEHSxLtrHL VVN9wIETXymFJjBx/oxU8eBYQo1I6yI+6BQsFYVVazxt4UOuWl6D7R8ryb1+hkyuuI7Q 72GFTTdCUKHxt5UC0ljuzNTL0CdP0yEWlPeenl6X4RJsGgGnVPeIxnA8mi1eao90z8aQ 2wgdhreDwBknAFPWw2zzvCbttOGkL051dW35PeKnN0ryGDH5Qbol0IgEEBYMizfC+zaH 4WaUa0QSW4/CfCM4QZCOtz2G0qG3OKG1uiNr6h/JH+YYyk5mbiPG7jp+Vi66FRS+31TU aNsQ== X-Gm-Message-State: AOAM531t2enqeSXnREvq1lBuel289ciF+q4xgE9RNUxcyPWFq6vUNwGF y/PvVm2wVgTfruhvKnH8DXmm9fiZvsLe4Wh1 X-Received: by 2002:adf:f34d:0:b0:1e3:3e54:cc96 with SMTP id e13-20020adff34d000000b001e33e54cc96mr3129361wrp.84.1645119832542; Thu, 17 Feb 2022 09:43:52 -0800 (PST) Received: from tsr-vdi-mbaerts.nix.tessares.net (static.23.216.130.94.clients.your-server.de. [94.130.216.23]) by smtp.gmail.com with ESMTPSA id 7sm23060203wrb.43.2022.02.17.09.43.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 09:43:51 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v2 8/9] selftests: mptcp: join: avoid backquotes Date: Thu, 17 Feb 2022 18:43:28 +0100 Message-Id: <20220217174329.826430-9-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220217174329.826430-1-matthieu.baerts@tessares.net> References: <20220217174329.826430-1-matthieu.baerts@tessares.net> 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" As explained on ShellCheck's wiki [1], it is recommended to avoid backquotes `...` in favour of parenthesis $(...): > Backtick command substitution `...` is legacy syntax with several > issues. > > - It has a series of undefined behaviors related to quoting in POSIX. > - It imposes a custom escaping mode with surprising results. > - It's exceptionally hard to nest. > > $(...) command substitution has none of these problems, and is > therefore strongly encouraged. [1] https://www.shellcheck.net/wiki/SC2006 Signed-off-by: Matthieu Baerts --- .../testing/selftests/net/mptcp/mptcp_join.sh | 70 ++++++++++--------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index ccd7d900c9f1..78d8bc1beb25 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -83,7 +83,7 @@ init_partial() # ns1eth4 ns2eth4 =20 local i - for i in `seq 1 4`; do + for i in $(seq 1 4); do ip link add ns1eth$i netns "$ns1" type veth peer name ns2eth$i netns "$n= s2" ip -net "$ns1" addr add 10.0.$i.1/24 dev ns1eth$i ip -net "$ns1" addr add dead:beef:$i::1/64 dev ns1eth$i nodad @@ -102,7 +102,7 @@ init_partial() init_shapers() { local i - for i in `seq 1 4`; do + for i in $(seq 1 4); do tc -n $ns1 qdisc add dev ns1eth$i root netem rate 20mbit delay 1 tc -n $ns2 qdisc add dev ns2eth$i root netem rate 20mbit delay 1 done @@ -834,7 +834,7 @@ chk_csum_nr() echo -n " " fi printf " %-36s %s" "$msg" "sum" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtDataCsumErr | awk '{= print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtDataCsumErr | awk '= {print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D 0 ]; then echo "[fail] got $count data checksum error[s] expected 0" @@ -844,7 +844,7 @@ chk_csum_nr() echo -n "[ ok ]" fi echo -n " - csum " - count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtDataCsumErr | awk '{= print $2}'` + count=3D$(ip netns exec $ns2 nstat -as | grep MPTcpExtDataCsumErr | awk '= {print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D 0 ]; then echo "[fail] got $count data checksum error[s] expected 0" @@ -864,7 +864,7 @@ chk_fail_nr() local dump_stats =20 printf "%-${nr_blank}s %s" " " "ftx" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPFailTx | awk '{pri= nt $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPFailTx | awk '{pr= int $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_fail_nr_tx" ]; then echo "[fail] got $count MP_FAIL[s] TX expected $mp_fail_nr_tx" @@ -875,7 +875,7 @@ chk_fail_nr() fi =20 echo -n " - frx " - count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtMPFailRx | awk '{pri= nt $2}'` + count=3D$(ip netns exec $ns2 nstat -as | grep MPTcpExtMPFailRx | awk '{pr= int $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_fail_nr_rx" ]; then echo "[fail] got $count MP_FAIL[s] RX expected $mp_fail_nr_rx" @@ -896,7 +896,7 @@ chk_infi_nr() local dump_stats =20 printf "%-${nr_blank}s %s" " " "itx" - count=3D`ip netns exec $ns2 nstat -as | grep InfiniteMapTx | awk '{print = $2}'` + count=3D$(ip netns exec $ns2 nstat -as | grep InfiniteMapTx | awk '{print= $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_infi_nr_tx" ]; then echo "[fail] got $count infinite map[s] TX expected $mp_infi_nr_tx" @@ -907,7 +907,7 @@ chk_infi_nr() fi =20 echo -n " - irx " - count=3D`ip netns exec $ns1 nstat -as | grep InfiniteMapRx | awk '{print = $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep InfiniteMapRx | awk '{print= $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_infi_nr_rx" ]; then echo "[fail] got $count infinite map[s] RX expected $mp_infi_nr_rx" @@ -930,7 +930,7 @@ chk_join_nr() local with_cookie =20 printf "%03u %-36s %s" "${TEST_COUNT}" "${TEST_NAME}" "syn" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx | awk '{= print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinSynRx | awk '= {print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$syn_nr" ]; then echo "[fail] got $count JOIN[s] syn expected $syn_nr" @@ -941,8 +941,8 @@ chk_join_nr() fi =20 echo -n " - synack" - with_cookie=3D`ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies` - count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx | awk= '{print $2}'` + with_cookie=3D$(ip netns exec $ns2 sysctl -n net.ipv4.tcp_syncookies) + count=3D$(ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinSynAckRx | aw= k '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$syn_ack_nr" ]; then # simult connections exceeding the limit with cookie enabled could go up= to @@ -960,7 +960,7 @@ chk_join_nr() fi =20 echo -n " - ack" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinAckRx | awk '{= print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinAckRx | awk '= {print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$ack_nr" ]; then echo "[fail] got $count JOIN[s] ack expected $ack_nr" @@ -993,9 +993,9 @@ chk_stale_nr() local recover_nr =20 printf "%-${nr_blank}s %-18s" " " "stale" - stale_nr=3D`ip netns exec $ns nstat -as | grep MPTcpExtSubflowStale | awk= '{print $2}'` + stale_nr=3D$(ip netns exec $ns nstat -as | grep MPTcpExtSubflowStale | aw= k '{print $2}') [ -z "$stale_nr" ] && stale_nr=3D0 - recover_nr=3D`ip netns exec $ns nstat -as | grep MPTcpExtSubflowRecover |= awk '{print $2}'` + recover_nr=3D$(ip netns exec $ns nstat -as | grep MPTcpExtSubflowRecover = | awk '{print $2}') [ -z "$recover_nr" ] && recover_nr=3D0 =20 if [ $stale_nr -lt $stale_min ] || @@ -1031,10 +1031,10 @@ chk_add_nr() local dump_stats local timeout =20 - timeout=3D`ip netns exec $ns1 sysctl -n net.mptcp.add_addr_timeout` + timeout=3D$(ip netns exec $ns1 sysctl -n net.mptcp.add_addr_timeout) =20 printf "%-${nr_blank}s %s" " " "add" - count=3D`ip netns exec $ns2 nstat -as MPTcpExtAddAddr | grep MPTcpExtAddA= ddr | awk '{print $2}'` + count=3D$(ip netns exec $ns2 nstat -as MPTcpExtAddAddr | grep MPTcpExtAdd= Addr | awk '{print $2}') [ -z "$count" ] && count=3D0 =20 # if the test configured a short timeout tolerate greater then expected @@ -1048,7 +1048,7 @@ chk_add_nr() fi =20 echo -n " - echo " - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtEchoAdd | awk '{prin= t $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtEchoAdd | awk '{pri= nt $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$echo_nr" ]; then echo "[fail] got $count ADD_ADDR echo[s] expected $echo_nr" @@ -1060,7 +1060,7 @@ chk_add_nr() =20 if [ $port_nr -gt 0 ]; then echo -n " - pt " - count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtPortAdd | awk '{pri= nt $2}'` + count=3D$(ip netns exec $ns2 nstat -as | grep MPTcpExtPortAdd | awk '{pr= int $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$port_nr" ]; then echo "[fail] got $count ADD_ADDR[s] with a port-number expected $port_n= r" @@ -1071,8 +1071,8 @@ chk_add_nr() fi =20 printf "%-${nr_blank}s %s" " " "syn" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinPortSynRx | - awk '{print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinPortSynRx | + awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$syn_nr" ]; then echo "[fail] got $count JOIN[s] syn with a different \ @@ -1084,8 +1084,8 @@ chk_add_nr() fi =20 echo -n " - synack" - count=3D`ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinPortSynAckRx | - awk '{print $2}'` + count=3D$(ip netns exec $ns2 nstat -as | grep MPTcpExtMPJoinPortSynAckRx= | + awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$syn_ack_nr" ]; then echo "[fail] got $count JOIN[s] synack with a different \ @@ -1097,8 +1097,8 @@ chk_add_nr() fi =20 echo -n " - ack" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinPortAckRx | - awk '{print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPJoinPortAckRx | + awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$ack_nr" ]; then echo "[fail] got $count JOIN[s] ack with a different \ @@ -1110,8 +1110,8 @@ chk_add_nr() fi =20 printf "%-${nr_blank}s %s" " " "syn" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMismatchPortSynRx | - awk '{print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMismatchPortSynRx | + awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mis_syn_nr" ]; then echo "[fail] got $count JOIN[s] syn with a mismatched \ @@ -1123,8 +1123,8 @@ chk_add_nr() fi =20 echo -n " - ack " - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMismatchPortAckRx | - awk '{print $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMismatchPortAckRx | + awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mis_ack_nr" ]; then echo "[fail] got $count JOIN[s] ack with a mismatched \ @@ -1160,7 +1160,7 @@ chk_rm_nr() fi =20 printf "%-${nr_blank}s %s" " " "rm " - count=3D`ip netns exec $addr_ns nstat -as | grep MPTcpExtRmAddr | awk '{p= rint $2}'` + count=3D$(ip netns exec $addr_ns nstat -as | grep MPTcpExtRmAddr | awk '{= print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$rm_addr_nr" ]; then echo "[fail] got $count RM_ADDR[s] expected $rm_addr_nr" @@ -1171,7 +1171,7 @@ chk_rm_nr() fi =20 echo -n " - sf " - count=3D`ip netns exec $subflow_ns nstat -as | grep MPTcpExtRmSubflow | a= wk '{print $2}'` + count=3D$(ip netns exec $subflow_ns nstat -as | grep MPTcpExtRmSubflow | = awk '{print $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$rm_subflow_nr" ]; then echo "[fail] got $count RM_SUBFLOW[s] expected $rm_subflow_nr" @@ -1192,7 +1192,7 @@ chk_prio_nr() local dump_stats =20 printf "%-${nr_blank}s %s" " " "ptx" - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPPrioTx | awk '{pri= nt $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPPrioTx | awk '{pr= int $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_prio_nr_tx" ]; then echo "[fail] got $count MP_PRIO[s] TX expected $mp_prio_nr_tx" @@ -1203,7 +1203,7 @@ chk_prio_nr() fi =20 echo -n " - prx " - count=3D`ip netns exec $ns1 nstat -as | grep MPTcpExtMPPrioRx | awk '{pri= nt $2}'` + count=3D$(ip netns exec $ns1 nstat -as | grep MPTcpExtMPPrioRx | awk '{pr= int $2}') [ -z "$count" ] && count=3D0 if [ "$count" !=3D "$mp_prio_nr_rx" ]; then echo "[fail] got $count MP_PRIO[s] RX expected $mp_prio_nr_rx" @@ -1222,8 +1222,10 @@ chk_link_usage() local link=3D$2 local out=3D$3 local expected_rate=3D$4 - local tx_link=3D`ip netns exec $ns cat /sys/class/net/$link/statistics/tx= _bytes` - local tx_total=3D`ls -l $out | awk '{print $5}'` + + local tx_link tx_total + tx_link=3D$(ip netns exec $ns cat /sys/class/net/$link/statistics/tx_byte= s) + tx_total=3D$(ls -l $out | awk '{print $5}') local tx_rate=3D$((tx_link * 100 / $tx_total)) local tolerance=3D5 =20 --=20 2.34.1