From nobody Tue Feb 10 01:31:36 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a05:6638:bd2:0:0:0:0 with SMTP id g18csp1953106jad; Thu, 24 Feb 2022 13:35:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPAHA4JGnApLAg4AxD2jcGy4JAvC+UJjv1y04S3lSSAI/ksXQZXXYui4xo/tRBSROhqVvM X-Received: by 2002:a17:902:b94b:b0:14e:f1a8:9b99 with SMTP id h11-20020a170902b94b00b0014ef1a89b99mr4656265pls.28.1645738505848; Thu, 24 Feb 2022 13:35:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645738505; cv=none; d=google.com; s=arc-20160816; b=F4PMRIBIDhGxssvyUtv/qwinh3gacKAvul/Xow1de3tn4ntVCqm58dv1A6xNv/KKpn YXOkcISfzUNMKDI5HLLXfnuppbPrisOlcLtOFHMAIUR8b4laEoWayQPT7y+gAW+jLH3q tk3J+zK2y2Hg7dQDCqtQVCJ0ibUBsi9Xtr9xSOrhGdqARUTA01QdBznMkpBV4ELDvi8n lHqTy1j7NPJPFTmPQHOJotpNZgvEj1fqzoNaoliAFx3c7XhOpPqBjDGOsu1mGVoLjxg0 5eVtWwDbCtEHOMcHYCayFNtA2/hZ7zCFusLN10z7ovXkyVakAk3oMibWFMHQXFJoFm4o igxg== 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=6qKdFGTaabyGfSQRaKcrY8DB6zt2H6moqludwTQ8Tzg=; b=cbHCznchFmbVu7PTG1JsM1XR2aPkx6i7ostOJDl5DOyKRddRbwlEHVRul6UVeYrnQ5 q1P8t35FWKG7HNzzr+PekoU+nsHL//d4AT9FGJ9PkE+qqMlN/zH5Na2BY1q3tvk+HRH1 RVcX76CofqZVHgsiz4uAZ6xChOc1USAMtnvUMApuJqoqDRzqr7TaCLwajvd1zub3loaY Wpf30Lx9UesGAauEBjwKRO2dmFKoJOggrTDP0oXycEApofB7AOouVG7koleymyQMXTQN QceK6mh/ZwivuD/crhadBbSsnqKUA+wvv/W1nJ1FkhT4ixP9Rkyx+PLr/Qp4nen4UybZ zPYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=CDw03D2l; spf=pass (google.com: domain of mptcp+bounces-4014-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4014-wpasupplicant.patchew=gmail.com@lists.linux.dev" Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id f10-20020a17090a4a8a00b001bc7e672640si398090pjh.164.2022.02.24.13.35.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Feb 2022 13:35:05 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-4014-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; dkim=pass header.i=@tessares-net.20210112.gappssmtp.com header.s=20210112 header.b=CDw03D2l; spf=pass (google.com: domain of mptcp+bounces-4014-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-4014-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 sjc.edge.kernel.org (Postfix) with ESMTPS id 530033E0F70 for ; Thu, 24 Feb 2022 21:35:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB3726AA5; Thu, 24 Feb 2022 21:35:03 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 9A3C96957 for ; Thu, 24 Feb 2022 21:35:01 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id s1so4682318edd.13 for ; Thu, 24 Feb 2022 13:35:01 -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=6qKdFGTaabyGfSQRaKcrY8DB6zt2H6moqludwTQ8Tzg=; b=CDw03D2lCXWAYLuP1WlIxdNLvR5AAqhPpiIXnWtn+I9mKhzRWkBj7FXpXIHSWzxJZ+ p8ke6TOGbekoa3xHRmtUL2ayTCSYpz5m2XXMNn/hLOhVy+dRZ7IONq3dvep181m9SbY1 TS6Jrn9IRz9k2Bj8NrqgI0OHaQbCDyyR2eHTVSvCJzLf8rbyEqdN8tVIxH4gg376smFd +oRYutTGMVNs2x0uyx3vfKK+Ce6guYMnHyI3dd3OdNk8GQnBOB0zQYWJYfCgJS3D7hon Xs33Ku75NXi35LweRlSje5RiKM5+ewrpFpR9QHLFYSDEtnJJUH7i3vAHw3SUsDfuFghz HQIQ== 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=6qKdFGTaabyGfSQRaKcrY8DB6zt2H6moqludwTQ8Tzg=; b=vuM4CIkzB94p5efXwmRzEiP+RgrIqwvtqH71cyQtw8AgoiOC6y41Tm0pBGrLu6qmEw Jol2PpSNrDvH7RbRXiBEpexppyBnsMyk5GJ1FIY8jxRoueW4B8M6qXA8DVycSalRC9jY FFOtHtGI9fJS1VcgK8CERHRoXKkRxuwTpXp1YBGFHvK69/+C4+9REV3hJ9askr/eqyP9 57/RfQ0v3Qd7JjKx+xiRr2KWfOQTslFv+B4y2ZfinDWbXsqA+PREyH0ZPTfCo97Mp2yd a09Zy7+4VUwHYWVLuGP3LLGV4rOjdUAu4MPg/Uokhtz4euzivBvW3PL2iS+yZZ/q5wGP ZaDw== X-Gm-Message-State: AOAM5311NN/xlkduBwMilSxCQ5RdpIMU8/oLEJ9mnydEwCMDL/F6LHWp tqy7ZPDbrV9rtc3BXdKR9luUx/FcwAcsiQKNXjM= X-Received: by 2002:a05:6402:1e8f:b0:3fa:72cb:1733 with SMTP id f15-20020a0564021e8f00b003fa72cb1733mr4163045edf.24.1645738499654; Thu, 24 Feb 2022 13:34:59 -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 z22-20020a17090655d600b006d229436793sm175195ejp.223.2022.02.24.13.34.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Feb 2022 13:34:58 -0800 (PST) From: Matthieu Baerts To: mptcp@lists.linux.dev Cc: Matthieu Baerts Subject: [PATCH mptcp-next v4 03/12] Squash to "selftests: mptcp: add implicit endpoint test case" Date: Thu, 24 Feb 2022 22:33:57 +0100 Message-Id: <20220224213406.3127061-4-matthieu.baerts@tessares.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220224213406.3127061-1-matthieu.baerts@tessares.net> References: <20220224213406.3127061-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" - Move 'wait_mpj' with the other 'wait' helpers: like that, we have all the helpers first and then all groups of tests. It is easier to find patterns in the tests parts, e.g. finding if there are direct calls to 'ip netns exec', etc. - Do not increment the counter for each subtest: later in this series the counter is incremented in the reset function and thanks to that it is possible to skip a test before doing the real reset part. It is then required to have a single test per test env. All the three test are quick when the env is ready. Signed-off-by: Matthieu Baerts --- Notes: to be squashed in "selftests: mptcp: add implicit endpoint test case" .../testing/selftests/net/mptcp/mptcp_join.sh | 53 ++++++++++--------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testin= g/selftests/net/mptcp/mptcp_join.sh index 02ae2692f7fc..d3985b9cf380 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -365,6 +365,21 @@ wait_rm_addr() done } =20 +wait_mpj() +{ + local ns=3D"${1}" + local cnt old_cnt + + old_cnt=3D$(ip netns exec ${ns} nstat -as | grep MPJoinAckRx | awk '{prin= t $2}') + + local i + for i in $(seq 10); do + cnt=3D$(ip netns exec ${ns} nstat -as | grep MPJoinAckRx | awk '{print $= 2}') + [ "$cnt" =3D "${old_cnt}" ] || break + sleep 0.1 + done +} + pm_nl_set_limits() { local ns=3D$1 @@ -468,9 +483,10 @@ pm_nl_change_endpoint() pm_nl_check_endpoint() { local line expected_line - local msg=3D"$1" - local addr=3D$3 - local ns=3D$2 + local title=3D"$1" + local msg=3D"$2" + local ns=3D$3 + local addr=3D$4 local _flags=3D"" local flags local _port @@ -479,10 +495,13 @@ pm_nl_check_endpoint() local _id local id =20 - TEST_COUNT=3D$((TEST_COUNT + 1)) - printf "%03u %-${nr_blank}s" "$TEST_COUNT" "$msg" + if [ -n "${title}" ]; then + printf "%03u %-36s %s" "${TEST_COUNT}" "${title}" "${msg}" + else + printf "%-${nr_blank}s %s" " " "${msg}" + fi =20 - shift 3 + shift 4 while [ -n "$1" ]; do if [ $1 =3D "flags" ]; then _flags=3D$2 @@ -2532,21 +2551,6 @@ userspace_tests() chk_rm_nr 0 0 } =20 -wait_mpj() -{ - local ns=3D"${1}" - local cnt old_cnt - - old_cnt=3D$(ip netns exec ${ns} nstat -as | grep MPJoinAckRx | awk '{prin= t $2}') - - local i - for i in $(seq 10); do - cnt=3D$(ip netns exec ${ns} nstat -as | grep MPJoinAckRx | awk '{print $= 2}') - [ "$cnt" =3D "${old_cnt}" ] || break - sleep 0.1 - done -} - implicit_tests() { # userspace pm type prevents add_addr @@ -2557,15 +2561,16 @@ implicit_tests() run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow & =20 wait_mpj $ns1 - pm_nl_check_endpoint "implicit EP creation" \ + TEST_COUNT=3D$((TEST_COUNT + 1)) + pm_nl_check_endpoint "implicit EP" "creation" \ $ns2 10.0.2.2 id 1 flags implicit =20 pm_nl_add_endpoint $ns2 10.0.2.2 id 33 - pm_nl_check_endpoint "implicit EP ID change is prevented" \ + pm_nl_check_endpoint "" "ID change is prevented" \ $ns2 10.0.2.2 id 1 flags implicit =20 pm_nl_add_endpoint $ns2 10.0.2.2 flags signal - pm_nl_check_endpoint "implicit EP modification is allowed" \ + pm_nl_check_endpoint "" "modif is allowed" \ $ns2 10.0.2.2 id 1 flags signal wait } --=20 2.34.1