From nobody Tue Feb 10 04:16:41 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:9f92:0:0:0:0:0 with SMTP id a18csp2433488jam; Wed, 9 Feb 2022 13:26:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa4F1eUW6Q5VCaa04imUUn9v08/Y/5GuXBtfcO5l9oOvOG6xgfMkFe28eYPNwIkHtgXmt6 X-Received: by 2002:ac8:57cf:: with SMTP id w15mr2812981qta.252.1644441960011; Wed, 09 Feb 2022 13:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644441960; cv=none; d=google.com; s=arc-20160816; b=ppBSplNWZ3YW7yEShWhavCmJGLaK+pkwdBe6cbzoS2+smuwnyYiiwIFtOnXJdcUPKx XUhUd4VZ9EJhu/1eFOjy/7w2b35cI+defCLQpetTz9lOtXdjLtpFzn3FXMNtyPOpjEy2 tAlVKDU35Q+f/L8PHiz22zxxLFxXSL4Kvm5OeOzotcfMaeBZZv6Km2saQbl+JeE+jm6a hJjp6vAht3ppgmVv5jTZAqpIBTj98t4J5O9P9XIhSBSw1QPGsuAdV90xDO4wb9TYhz3+ QTc1AQpHKDAEc8n/kfgJUDWDWjThhoZykOexKLEUqhHTa6JEvvbAUxNCYu/eSnuw2WOO Gtsg== 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=Ve71QE+CKR2fEdrkxRcg9nDk3jNnHMgDgR1Zr5zelSQ=; b=X2U45QCfAjBIofPJAXWFe885avKl8SnRIP6Is139E1iLBqJtAhFnstB7Q7w2TPmsHa w1+Q0608OsMqqybvikYI3jjBzraK5ORH4FgKSHmf+vh7/ap3tG8UzQalsDiu4bYOchjq yX5PvjR8Mb7sy+2Tw30eIg+k4qrF5hcx6xfxNn47Xg2BcehmOm0VCIZZ8x2DyC8utZpw Gj8+98YD6hhfDgypvk4eGcOuOZwLyo/XTqnzYd93rP+E0djKATM5Gc5vMat3gO4tCb7I HRDNcEeEtoRv/IuXjT3nsLQWFb4S3HfJaL9glQyLKnmWavJxD3HpRPBJB5ngF0SThwVG wb2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=xEDUPR+e; spf=pass (google.com: domain of mptcp+bounces-3597-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3597-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 v12si4161430qkl.253.2022.02.09.13.25.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Feb 2022 13:25:59 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-3597-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=xEDUPR+e; spf=pass (google.com: domain of mptcp+bounces-3597-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-3597-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 88EFB1C0EE1 for ; Wed, 9 Feb 2022 21:25:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7CD5B2CA5; Wed, 9 Feb 2022 21:25:54 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 BEBC22C80 for ; Wed, 9 Feb 2022 21:25:52 +0000 (UTC) Received: by mail-wm1-f51.google.com with SMTP id l67-20020a1c2546000000b00353951c3f62so2571467wml.5 for ; Wed, 09 Feb 2022 13:25:52 -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=Ve71QE+CKR2fEdrkxRcg9nDk3jNnHMgDgR1Zr5zelSQ=; b=xEDUPR+eA/AiFcTx486LAAag85asOdL5hiyUroDSbfliguxyx0oXxGnponNqEukEiZ MFu5wTVkYYF5UmdVXVPmontzNosRjiPXFIBSk/pS3e+Q/G5F4Y558keYFOUXvLb+2SI+ O8NOeNyo78ndsjY0kwMxgFX1fsZf2/l74HFel8MA57C5n72AJbtn33opVsko72Zdv8Vl vGrruvS/5k6qijmwn6XdMKESMUOPxCML7P9ArDXJN5x04qjs3BjzGoUJY45tVHi40a+H 2aVLeb2xzYbN1tH4L8orxHi9vOEb24fKaVWS4+/0Fxk4Zhg/Ia67ycogShDc8+aLN7W4 Kx7A== 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=Ve71QE+CKR2fEdrkxRcg9nDk3jNnHMgDgR1Zr5zelSQ=; b=NDhMjeayBe+5g6zjzRC5ivW6A57d6LRp809HhxRSqzYekX3s1vz6c8qsHC5+CIoI79 YVAgO0e+Td9LezGPr1vJNRGIOqt5iGK9soitLWJYESlYnVOledjK8PSg6appc9z5bF98 PHGNIMtIBD4j+ePKgKE7j8strqJeo4IsN+QgeL44DWvZHdXJ5yi043YsccL/AWiKyC+h 094E/kGcfgYStVpszcNqLQJ0hjXkn3i7ATcQXHkCbDs2jB9Nsla9GuNairQYCVnoFc6A vAOo9mgmtbGEZNmweJcjQb8h1uOd+L00KN0li8Gg7hVjlSyVf/CY4B85bYoeb/zMIId0 hX1w== X-Gm-Message-State: AOAM5315mCnuBmHoedFoYxgyJ0DlgtiefMgmjURBRqK50M9hfA6B0N6u zlN4czPHLPDgQuSxqCEmJUaXKSsl2/w2aTYa X-Received: by 2002:a7b:c778:: with SMTP id x24mr3778709wmk.11.1644441950804; Wed, 09 Feb 2022 13:25:50 -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 p14sm18500730wrr.7.2022.02.09.13.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 13:25:50 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next 8/9] selftests: mptcp: join: avoid backquotes Date: Wed, 9 Feb 2022 22:25:19 +0100 Message-Id: <20220209212520.2989291-9-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220209212520.2989291-1-matthieu.baerts@tessares.net> References: <20220209212520.2989291-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 15e642e0fa03..c39d5b4e73cb 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -75,7 +75,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 @@ -94,7 +94,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 @@ -605,7 +605,7 @@ do_transfer() else addr=3D"10.0.$counter.2" fi - pm_nl_add_endpoint $ns2 $addr flags $flags + pm_nl_add_endpoint $NS2 $addr flags $flags let counter+=3D1 let add_nr_ns2-=3D1 done @@ -791,7 +791,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" @@ -801,7 +801,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" @@ -821,7 +821,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" @@ -832,7 +832,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" @@ -853,7 +853,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" @@ -864,7 +864,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" @@ -887,7 +887,7 @@ chk_join_nr() local dump_stats =20 printf "%03u %-36s %s" "$TEST_COUNT" "$msg" "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" @@ -898,7 +898,7 @@ chk_join_nr() fi =20 echo -n " - synack" - count=3D`ip netns exec $NS2 nstat -as | grep MPTcpExtMPJoinSynAckRx | awk= '{print $2}'` + 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 echo "[fail] got $count JOIN[s] synack expected $syn_ack_nr" @@ -909,7 +909,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" @@ -942,9 +942,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 ] || @@ -980,10 +980,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 @@ -997,7 +997,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" @@ -1009,7 +1009,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" @@ -1020,8 +1020,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 \ @@ -1033,8 +1033,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 \ @@ -1046,8 +1046,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 \ @@ -1059,8 +1059,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 \ @@ -1072,8 +1072,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 \ @@ -1109,7 +1109,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" @@ -1120,7 +1120,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" @@ -1141,7 +1141,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" @@ -1152,7 +1152,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" @@ -1171,8 +1171,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