From patchwork Wed Jul 12 16:03:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 119275 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp1268521vqm; Wed, 12 Jul 2023 09:29:21 -0700 (PDT) X-Google-Smtp-Source: APBJJlGiHC6Q8b41ToPebHyqa075gjfm5mQMcUGttZ1MxNXKayqFuYSFwDH+4HsBZEh9YxC5HWf1 X-Received: by 2002:a05:6a00:a1e:b0:66f:578c:59fb with SMTP id p30-20020a056a000a1e00b0066f578c59fbmr19037373pfh.10.1689179361481; Wed, 12 Jul 2023 09:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689179361; cv=none; d=google.com; s=arc-20160816; b=VR7cZhehmu/bfV3Y9hNvP8pYl14rbe4IRSC+s1kp7AscMoYvbJctQj47bQbxO+shU1 eZORN/6fRS4HEtnL0yLoUiA1eDOhq7X4C+95KxpYqV6XsT+YSrVnyT03LAo5oTwoOlh8 HG0WPAipS3o+Sqa/XderZ9fnaAhwLn5j0HE9BlmFsc9CvvyOFlsx8cV8oIXaKZvB9jM4 dBEuomiqLxmjxFte93aPyRUIrOUA1/J19yLt4oy39xgpZuBBGjfEtHpa2smybYFTtenB zDyqWQLQcSolImgQD2keE7d1ngzPNUVCQNDfm9CoPppCgiY5NcxZaRPf4LrbjyHzm9gj hyAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=YkaSkbg1hj7zqdIEy25ren99Ahk0q9+Tgw9lEzP9lo8=; fh=W5rn1gG81nIyOp2AvYKIXDwIEy66US4qHO9dtkppJI0=; b=V2Jp/VRp+FBptdE/0GH03gFWBCnyZlEgls2K4wm9PACDYBMePjZ5q8nKsH4kSnW8zF 1QHzYN1gsFeFRmquYgLrXrM8cL9m0uJz5AxqSgyXeOoPOLcvRQryu+Kt0Um5KRjsHs7w 5soEZBBmI+5oNK6fJ1ueWNYQcnJmD1aromBxcx+R07dztjI8lZq5AbngunCBAU5VBDzL VxDmOBrvjcIoRrJOmJIftb21fWNm7e/kxditQEHNsuce62imyEyqaxbncCLu6Amk+XT8 GiVGW+QFRzsbbGQYvRkkTpda354TWaDHMvvV70uQwdgJ4om5Qk0fNOzWITgCVO6ZGdlu mPKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="B/JnRNFZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a63e54e000000b0055acfb661casi1515824pgj.894.2023.07.12.09.29.08; Wed, 12 Jul 2023 09:29:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b="B/JnRNFZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233553AbjGLQDe (ORCPT + 99 others); Wed, 12 Jul 2023 12:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233545AbjGLQDb (ORCPT ); Wed, 12 Jul 2023 12:03:31 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF50B1BEA for ; Wed, 12 Jul 2023 09:03:29 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbc1218262so79501625e9.3 for ; Wed, 12 Jul 2023 09:03:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; t=1689177808; x=1691769808; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=YkaSkbg1hj7zqdIEy25ren99Ahk0q9+Tgw9lEzP9lo8=; b=B/JnRNFZkPvmYIdrxaB+EY9/V3oHuNOtdmeDLi9tEmtTDUSRTx9pefe7v3PNl+UkVx i2raTidHLHWb3HHoHBmYpu9DbzQPUdH6ayA0QIwpxGh2RWVqk/lh7Vmv792L0IiCjP94 ecGqMpcejL46kdyPdxIH0n8v991/xkmxU0r0I35R+azGLQDyX4EcWC6DlfCM3bv5rmKz CxwkGw/VfIh5aPUkSNW1B4s1tbV4E9efBq/DnTnXfebJDUnQwiywQmWeS6oNYr7gE75H jEH/rqTvEmhivuEGQySlukN8PVKuvTkLv1s0ruT0MTH5JLTYCK+9ptG8Q42ekNbvCDPd MeYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689177808; x=1691769808; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YkaSkbg1hj7zqdIEy25ren99Ahk0q9+Tgw9lEzP9lo8=; b=Hzrp3cQMJJwONxXYcz9VCZ2J5H3MrRshN0PaGVVreC4MC80q09sQNzehAcEviqIMoN N+vRGkoVoL8O1CsVlwJ5ERMqS5o1ONSpTRe4DuDHjef3yuzl+3vKx+q50oJX0aqxxSgg azY9TVyMVu88A4ESAfirC4DH30p3aixD1wWc8NZxmMEA4tfDQVEqMQ/NrIIHx4kj4SIS otBCb9Kh+LfSB3YlohqFYbw0lGZT4hfbu9wOtn0kM1NT5tt42NFMxbQx5VjvIpAOAoSD I3tpVxO7ssd8FpW1UKcdOtzktc1JixR5KqRigNUWFVAGyzTA0PCZNtyiq9bu/IqD8mwe 3JOQ== X-Gm-Message-State: ABy/qLb0DKxGuVUFuF24L3I/ZmMhja7Xwuq1SwY6FjRB1hgs0uT7Nrar 6X2IY+wL4hxxF4EXrFo8eoHG8g== X-Received: by 2002:a1c:f706:0:b0:3fb:b637:22a7 with SMTP id v6-20020a1cf706000000b003fbb63722a7mr20401987wmh.4.1689177807717; Wed, 12 Jul 2023 09:03:27 -0700 (PDT) Received: from vdi08.nix.tessares.net (static.219.156.76.144.clients.your-server.de. [144.76.156.219]) by smtp.gmail.com with ESMTPSA id o6-20020a05600c378600b003fbb9339b29sm15972581wmr.42.2023.07.12.09.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 09:03:27 -0700 (PDT) From: Matthieu Baerts Date: Wed, 12 Jul 2023 18:03:16 +0200 Subject: [PATCH net-next 1/4] selftests: mptcp: set all env vars as local ones MIME-Version: 1.0 Message-Id: <20230712-upstream-net-next-20230712-selftests-mptcp-use-local-env-v1-1-f1c8b62fbf95@tessares.net> References: <20230712-upstream-net-next-20230712-selftests-mptcp-use-local-env-v1-0-f1c8b62fbf95@tessares.net> In-Reply-To: <20230712-upstream-net-next-20230712-selftests-mptcp-use-local-env-v1-0-f1c8b62fbf95@tessares.net> To: mptcp@lists.linux.dev, Mat Martineau , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: Geliang Tang , netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Matthieu Baerts X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2199; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=Giom2KcA4rMDsRQaqzRL7L0ciHAM8FES0ASumSNjEII=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBkrs7NfKP2BTFBzVZodXxBjqEvsLpgFYb6dQ+Ys 6pCxH1Fm7KJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZK7OzQAKCRD2t4JPQmmg c71WEADAmsB+mm1iB3CpKf8c7tcm9ZhppYpf+iHLo9QvuDGC2wriRvnuErCl8euzoqq+c6tBYxz Pm9EOcu97ZKbUdnXwgZuCxJo2j58sVt0Nuan6+/1COMrncKFLceP3cFr53ZEaxOpnNaSIWgi7uJ ldDQjSpZzt4TZplxeH5RxOJsuuHX+zPeqxDrIAaFN/3NGWqZXsUqHIsS5by6cfGjjJPmizK7V3y kcybWPkx5ipyojMJE00rO8FlBnH/GK5w2GDMHiNjS8Agkbm/+MvUD587QYgfiztyMchnglWg4hr IXNNX8OfNU+s7pevJlaWSlnHfLUHwZJX0dqeO8fIp1/u+hiNplUDegT4PTmErJ5c6TpQGyl62yj hFBCQZYhPngNEYYGx2QpUtbYrRaXDwKWi91josmZnTOgENXVbu1EZDkKeLIXwI5d/+ifqFnrRz3 u0G6unM0CSeIFTPO1i8QWYmw2pwk7kpE4AL25BUwAzSpx8NyBqEB/9LIUeC3jEfMY/DPyTCiJc2 572YaE9x+XONCjvKYaTZBT1FuytunJxwlt1xsxYumjc+mO31hUnRPNuzVsmhymL0PLzpcJdKucP WXrndsShO8/zw+jFkyQGlfyxd1BiKn0fM6QkKiSelQ5KYwWEXMgfCkkC3no7TovOUgt3a7SnE0T 6g2lsy1JxCKdFRw== X-Developer-Key: i=matthieu.baerts@tessares.net; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771232938267376974 X-GMAIL-MSGID: 1771232938267376974 From: Geliang Tang It would be better to move the declaration of all the env variables to do_transfer(), run_tests(), or pm_nl_set_endpoint() as local variables, instead of exporting them globally at the beginning of the file. Signed-off-by: Geliang Tang Reviewed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index e6c9d5451c5b..b0aaeead56c4 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -49,11 +49,12 @@ TEST_COUNT=0 TEST_NAME="" nr_blank=40 -export FAILING_LINKS="" -export test_linkfail=0 -export addr_nr_ns1=0 -export addr_nr_ns2=0 -export sflags="" +# These var are used only in some tests, make sure they are not already set +unset FAILING_LINKS +unset test_linkfail +unset addr_nr_ns1 +unset addr_nr_ns2 +unset sflags # generated using "nfbpf_compile '(ip && (ip[54] & 0xf0) == 0x30) || # (ip6 && (ip6[74] & 0xf0) == 0x30)'" @@ -100,7 +101,6 @@ init_partial() stats_dumped=0 check_invert=0 validate_checksum=$checksum - FAILING_LINKS="" # ns1 ns2 # ns1eth1 ns2eth1 @@ -828,6 +828,10 @@ pm_nl_set_endpoint() local connector_ns="$2" local connect_addr="$3" + local addr_nr_ns1=${addr_nr_ns1:-0} + local addr_nr_ns2=${addr_nr_ns2:-0} + local sflags=${sflags:-""} + # let the mptcp subflow be established in background before # do endpoint manipulation if [ $addr_nr_ns1 != "0" ] || [ $addr_nr_ns2 != "0" ]; then @@ -979,6 +983,7 @@ do_transfer() local port=$((10000 + TEST_COUNT - 1)) local cappid + local FAILING_LINKS=${FAILING_LINKS:-""} :> "$cout" :> "$sout" @@ -1158,6 +1163,7 @@ run_tests() local speed="${4:-fast}" local size + local test_linkfail=${test_linkfail:-0} # The values above 2 are reused to make test files # with the given sizes (KB)