From patchwork Fri Feb 18 03:03:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750881 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACB39C433FE for ; Fri, 18 Feb 2022 03:03:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231774AbiBRDDi (ORCPT ); Thu, 17 Feb 2022 22:03:38 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231779AbiBRDDf (ORCPT ); Thu, 17 Feb 2022 22:03:35 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E126359A41 for ; Thu, 17 Feb 2022 19:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153399; x=1676689399; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rJcUjjhStw1S/M4Ov0UOD4j8IEQ/i/HzgPMq0VdQJRk=; b=eEGp8XvugsT+JzrOSKIYZJ+26G4msi5BUCQHcYW1vtcOwQVz0MhNIJRC /QTp3znwJYapPIjSfuZyaD5BXz3HcUqXOCslbpeHKn5hvANqaHUXy/w5c NodTYLe/Ti/k0h99aXBrUgrm5lXhqAbGWWfCxlHxuL5JQhWnEz9dSRPCA rcD+RGSbusfceRYfrI/7YbWdIjRfB/Jr2n31BK/mxv27DKAywaUxhz3PU h9fllixXtnoVaQ3oYyAr1ILayDPd3HvudfuDBErkw3P3BIzFF2aF19OXM ZsoC2r0jwRUmGntdEwaF7n269ZijrRgJZNa71giiUraMmpEugJ9JLWnUH Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794592" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794592" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:18 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431891" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:17 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 1/7] selftests: mptcp: increase timeout to 20 minutes Date: Thu, 17 Feb 2022 19:03:05 -0800 Message-Id: <20220218030311.367536-2-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts With the increase number of tests, one CI instance, using a debug kernel config and not recent hardware, takes around 10 minutes to execute the slowest MPTCP test: mptcp_join.sh. Even if most CIs don't take that long to execute these tests -- typically max 10 minutes to run all selftests -- it will help some of them if the timeout is increased. The timeout could be disabled but it is always good to have an extra safeguard, just in case. Please note that on slow public CIs with kernel debug settings, it has been observed it can easily take up to 45 minutes to execute all tests in this very slow environment with other jobs running in parallel. The slowest test, mptcp_join.sh takes ~30 minutes in this case. In such environments, the selftests timeout set in the 'settings' file is disabled because this environment is known as being exceptionnally slow. It has been decided not to take such exceptional environments into account and set the timeout to 20min. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/settings b/tools/testing/selftests/net/mptcp/settings index a62d2fa1275c..79b65bdf05db 100644 --- a/tools/testing/selftests/net/mptcp/settings +++ b/tools/testing/selftests/net/mptcp/settings @@ -1 +1 @@ -timeout=600 +timeout=1200 From patchwork Fri Feb 18 03:03:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750880 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F375CC433F5 for ; Fri, 18 Feb 2022 03:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231772AbiBRDDh (ORCPT ); Thu, 17 Feb 2022 22:03:37 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231781AbiBRDDf (ORCPT ); Thu, 17 Feb 2022 22:03:35 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F5459A4B for ; Thu, 17 Feb 2022 19:03:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153400; x=1676689400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WbGXLDoYtJJu27wCa1qwhlZvWNzqWHDcYOCMw2OmxPg=; b=T5zKQvtnHwvwgg3B37Ubfidxk1AZMszdMmCZe3Weo1F5+87GtF+4YQb4 KZQJmWynSnuaDZMYmSB9kEjlLrSq3n+Ac/eYdNkz7talaUnVQW3JXmffS vcpVt5zwPHqlDcfHtOr3XQsnWqrwsBaoQYliVEUyVYhuhKu3+PQqG+ZET L9Y7wNgysCb6/wqiop/18gyMG4UgGZ0PZH3rR0jC9ouyPHem49ZG+8jhJ t3M67Q6EJxkp9hTLed/aJl7tQ7TmvDCJYjsWAjrfu9DTLwyPI5DRn3wx6 vj1wz5y9Q23P85QoOaTMpobxf5QssR2MjWmkPR/RoVkShGi/GLipKMJ1N A==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794594" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794594" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:18 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431898" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:17 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Geliang Tang , davem@davemloft.net, kuba@kernel.org, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 2/7] selftests: mptcp: simplify pm_nl_change_endpoint Date: Thu, 17 Feb 2022 19:03:06 -0800 Message-Id: <20220218030311.367536-3-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Geliang Tang This patch simplified pm_nl_change_endpoint(), using id-based address lookups only. And dropped the fragile way of parsing 'addr' and 'id' from the output of pm_nl_show_endpoints(). Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- .../testing/selftests/net/mptcp/mptcp_join.sh | 37 ++++--------------- 1 file changed, 8 insertions(+), 29 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 18bb0d0cf4bd..bbcacaaf81ce 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -240,16 +240,6 @@ is_v6() [ -z "${1##*:*}" ] } -is_addr() -{ - [ -z "${1##*[.:]*}" ] -} - -is_number() -{ - [[ $1 == ?(-)+([0-9]) ]] -} - # $1: ns, $2: port wait_local_port_listen() { @@ -379,16 +369,13 @@ pm_nl_show_endpoints() pm_nl_change_endpoint() { local ns=$1 - local flags=$2 - local id=$3 - local addr=$4 - local port="" + local id=$2 + local flags=$3 if [ $ip_mptcp -eq 1 ]; then ip -n $ns mptcp endpoint change id $id ${flags//","/" "} else - if [ $5 -ne 0 ]; then port="port $5"; fi - ip netns exec $ns ./pm_nl_ctl set $addr flags $flags $port + ip netns exec $ns ./pm_nl_ctl set id $id flags $flags fi } @@ -591,24 +578,16 @@ do_transfer() for netns in "$ns1" "$ns2"; do pm_nl_show_endpoints $netns | while read line; do local arr=($line) - local addr - local port=0 + local nr=0 local id for i in ${arr[@]}; do - if is_addr $i; then - addr=$i - elif is_number $i; then - # The minimum expected port number is 10000 - if [ $i -gt 10000 ]; then - port=$i - # The maximum id number is 255 - elif [ $i -lt 255 ]; then - id=$i - fi + if [ $i = "id" ]; then + id=${arr[$nr+1]} fi + let nr+=1 done - pm_nl_change_endpoint $netns $sflags $id $addr $port + pm_nl_change_endpoint $netns $id $sflags done done fi From patchwork Fri Feb 18 03:03:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750882 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C5BCC433F5 for ; Fri, 18 Feb 2022 03:03:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231800AbiBRDDj (ORCPT ); Thu, 17 Feb 2022 22:03:39 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231782AbiBRDDf (ORCPT ); Thu, 17 Feb 2022 22:03:35 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E32459A4E for ; Thu, 17 Feb 2022 19:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153400; x=1676689400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XNSbF2ralo2Cs3IT9LvtSwn9jScnNXYztNFwwiSYUqQ=; b=inB//s+pk4zz0ZrkRsnAGYWj8SsuV6p+nQ7vl5QLoYAseZ0PGp8jYQFe GI7U498DXxN552jJUJzo2a7RwFsiFmFG3PE1TsDVZTwQZuktDFrPMf1Lv e0BHY169Rkh+osbdgenUbQNsbqQreTNi3POky2X9JN+weiu9RTS70vWaX xvgEmMnNjv/pUR7vEZbdVVsi56vrQgm9vXNGUW8OO2zuZAy074X5/0XfZ 6pNXecuOAlK+ks7w8L7a5dLVW9r3JSXvP4AG/ed2WskPDLjktN8ghJhno CLm6LOYD9kKfOK3/NXKqAkHcQKkiHY0Ye3iUb9kDmPd/c04oXkIqPISgf Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794595" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794595" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:18 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431904" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:18 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 3/7] selftests: mptcp: join: exit after usage() Date: Thu, 17 Feb 2022 19:03:07 -0800 Message-Id: <20220218030311.367536-4-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts With an error if it is an unknown option. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index bbcacaaf81ce..1a881a21e7ef 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -2077,8 +2077,14 @@ all_tests() fullmesh_tests } +# [$1: error message] usage() { + if [ -n "${1}" ]; then + echo "${1}" + ret=1 + fi + echo "mptcp_join usage:" echo " -f subflows_tests" echo " -e subflows_error_tests" @@ -2099,6 +2105,8 @@ usage() echo " -C enable data checksum" echo " -i use ip mptcp" echo " -h help" + + exit ${ret} } sin=$(mktemp) @@ -2187,9 +2195,12 @@ while getopts 'fesltra64bpkdmchCSi' opt; do ;; i) ;; - h | *) + h) usage ;; + *) + usage "Unknown option: -${opt}" + ;; esac done From patchwork Fri Feb 18 03:03:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750883 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BFC7C433FE for ; Fri, 18 Feb 2022 03:03:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231782AbiBRDDl (ORCPT ); Thu, 17 Feb 2022 22:03:41 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231785AbiBRDDg (ORCPT ); Thu, 17 Feb 2022 22:03:36 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E95959A53 for ; Thu, 17 Feb 2022 19:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153400; x=1676689400; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=U1szUR6pqUI2yP1NLV6igd+jmVjkx9CEqyJEDcke89k=; b=bLQ2AoyWpkOB+QvxLoq+DvYhutUvWSMjBGM808WfruoOQQaYVFl3WQN9 ow+oLYuELv26uM0SN+QshLCnd8JuOzHgLv9SWcSOMQ+zkEwRyftOnZays gEIlW4cXQdGPygvMI3KU2MBdG3FGaJqA3aQsU0NtWe5liA6N5o0Oy5eZT LgY9ik5glRjWgffp3uR3JDptJaWyxo90PfUN7u3ZXQp+dE0xGoVmu8DFn cfqCrEOamDs4YH83LXC8z6xMk3zUdmkC5edGfiNIjZ6Aar725AUHa8LAp Vk/SXZSoBZTt233U+7mqcafRfASesZvzjQXl+cXnZvqrnVhOErxQsPl5Z w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794596" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794596" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431917" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:18 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 4/7] selftests: mptcp: join: remove unused vars Date: Thu, 17 Feb 2022 19:03:08 -0800 Message-Id: <20220218030311.367536-5-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts Shellcheck found that these variables were set but never used. Note that rndh is no longer prefixed with '0-' but it doesn't change anything. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- tools/testing/selftests/net/mptcp/mptcp_join.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 1a881a21e7ef..c6379093f38a 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -42,7 +42,7 @@ init() { capout=$(mktemp) - rndh=$(printf %x $sec)-$(mktemp -u XXXXXX) + rndh=$(mktemp -u XXXXXX) ns1="ns1-$rndh" ns2="ns2-$rndh" @@ -665,8 +665,6 @@ run_tests() addr_nr_ns2="${6:-0}" speed="${7:-fast}" sflags="${8:-""}" - lret=0 - oldin="" # create the input file for the failure test when # the first failure test run @@ -694,7 +692,6 @@ run_tests() do_transfer ${listener_ns} ${connector_ns} MPTCP MPTCP ${connect_addr} \ ${test_linkfail} ${addr_nr_ns1} ${addr_nr_ns2} ${speed} ${sflags} - lret=$? } dump_stats() From patchwork Fri Feb 18 03:03:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750884 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5E44C433EF for ; Fri, 18 Feb 2022 03:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231803AbiBRDDm (ORCPT ); Thu, 17 Feb 2022 22:03:42 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231796AbiBRDDg (ORCPT ); Thu, 17 Feb 2022 22:03:36 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9237F59A61 for ; Thu, 17 Feb 2022 19:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153401; x=1676689401; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A4UCyKVS+ECivE7dWa84k+oB0wXq0H5Wl3tdPlE5ETM=; b=Hpf265KoG3jg1fRRmsZUjt23RB6QAKW5XiaFv25uvcFbVSZtH3QnHuxy 7pwfMAXZB5S1Cr/brWKAZB+j1NQStId0bTi2/0/tXTWqSY+9G1fpvABnZ lJAbrx2lVPc/j/bVsJP615b32GYqUYbC6bTY0vxBPegiBkhTbXxxBFA4W 5DM2Anjh6lWZbfuSAarhlT+kfZOqad3tsZOHMg7Z4cZiBb+O+f0XLZ0Uk MGYBAEH6Is/VhQKzmrEerqCBw+0II/m0e0FdMUGDBhW84CnWMJBknLiUW tsAnjXUHHkGVcr7Awt9v4Q9OKSzQNjqIuZoiHMQGO2zEkGKV7FN/Ft/Cw g==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794598" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794598" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431937" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 5/7] selftests: mptcp: join: create tmp files only if needed Date: Thu, 17 Feb 2022 19:03:09 -0800 Message-Id: <20220218030311.367536-6-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts These tmp files will only be created when a test will be launched. This avoid 'dd' output when '-h' is used for example. While at it, also avoid creating netns that will be removed when starting the first test. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- .../testing/selftests/net/mptcp/mptcp_join.sh | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index c6379093f38a..63340bb76920 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -17,6 +17,7 @@ capture=0 checksum=0 ip_mptcp=0 do_all_tests=1 +init=0 TEST_COUNT=0 @@ -38,7 +39,7 @@ CBPF_MPTCP_SUBOPTION_ADD_ADDR="14, 6 0 0 65535, 6 0 0 0" -init() +init_partial() { capout=$(mktemp) @@ -98,6 +99,21 @@ cleanup_partial() done } +init() { + init=1 + + sin=$(mktemp) + sout=$(mktemp) + cin=$(mktemp) + cinsent=$(mktemp) + cout=$(mktemp) + + trap cleanup EXIT + + make_file "$cin" "client" 1 + make_file "$sin" "server" 1 +} + cleanup() { rm -f "$cin" "$cout" "$sinfail" @@ -107,8 +123,13 @@ cleanup() reset() { - cleanup_partial - init + if [ "${init}" != "1" ]; then + init + else + cleanup_partial + fi + + init_partial } reset_with_cookies() @@ -2106,16 +2127,6 @@ usage() exit ${ret} } -sin=$(mktemp) -sout=$(mktemp) -cin=$(mktemp) -cinsent=$(mktemp) -cout=$(mktemp) -init -make_file "$cin" "client" 1 -make_file "$sin" "server" 1 -trap cleanup EXIT - for arg in "$@"; do # check for "capture/checksum" args before launching tests if [[ "${arg}" =~ ^"-"[0-9a-zA-Z]*"c"[0-9a-zA-Z]*$ ]]; then From patchwork Fri Feb 18 03:03:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750885 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B2E8C433FE for ; Fri, 18 Feb 2022 03:03:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231809AbiBRDDn (ORCPT ); Thu, 17 Feb 2022 22:03:43 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231789AbiBRDDh (ORCPT ); Thu, 17 Feb 2022 22:03:37 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 921F858E6A for ; Thu, 17 Feb 2022 19:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153401; x=1676689401; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ChdVtpx2FTn8UBnKC5Z+NGmbaMbZRte5dZCcVFncSNY=; b=Eyh2uxhmfaQRsG7vPYtIuTABeAEDldI8YhXjq82OUmk2jKeXm+3sw7vE 1F0pzl0Cfxj3plueRaxZsz4UifZ8NaoT7Cl6/hpCoV9k94qWIovItJ37a YwZHwYyVJVRGIQiYccjoeR4Stiy0AWpvCpm5hDXLCn6O0MynIxXaFChpQ yk56K6vjDNWpxc4rLbBDep0+NLft/g0AD4I+aAK83mMpYYFvFDxKvBsCo fbZmPzk5nqddlNdOIZDFf2CB8ktgby6eUKF9kbIP/ycsJR+uNkRtfSHJA AgrGduqbhU4OCTMVPZGe+GkBJjb4wC4IFroRSdG6vXKWjiaUG8fymkXit g==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794599" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794599" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431953" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Matthieu Baerts , davem@davemloft.net, kuba@kernel.org, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 6/7] selftests: mptcp: join: check for tools only if needed Date: Thu, 17 Feb 2022 19:03:10 -0800 Message-Id: <20220218030311.367536-7-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Matthieu Baerts To allow showing the 'help' menu even if these tools are not available. While at it, also avoid launching the command then checking $?. Instead, the check is directly done in the 'if'. Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau --- .../testing/selftests/net/mptcp/mptcp_join.sh | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh index 63340bb76920..725924012b41 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_join.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh @@ -99,9 +99,29 @@ cleanup_partial() done } +check_tools() +{ + if ! ip -Version &> /dev/null; then + echo "SKIP: Could not run test without ip tool" + exit $ksft_skip + fi + + if ! iptables -V &> /dev/null; then + echo "SKIP: Could not run all tests without iptables tool" + exit $ksft_skip + fi + + if ! ip6tables -V &> /dev/null; then + echo "SKIP: Could not run all tests without ip6tables tool" + exit $ksft_skip + fi +} + init() { init=1 + check_tools + sin=$(mktemp) sout=$(mktemp) cin=$(mktemp) @@ -183,24 +203,6 @@ reset_with_allow_join_id0() ip netns exec $ns2 sysctl -q net.mptcp.allow_join_initial_addr_port=$ns2_enable } -ip -Version > /dev/null 2>&1 -if [ $? -ne 0 ];then - echo "SKIP: Could not run test without ip tool" - exit $ksft_skip -fi - -iptables -V > /dev/null 2>&1 -if [ $? -ne 0 ];then - echo "SKIP: Could not run all tests without iptables tool" - exit $ksft_skip -fi - -ip6tables -V > /dev/null 2>&1 -if [ $? -ne 0 ];then - echo "SKIP: Could not run all tests without ip6tables tool" - exit $ksft_skip -fi - print_file_err() { ls -l "$1" 1>&2 From patchwork Fri Feb 18 03:03:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mat Martineau X-Patchwork-Id: 12750886 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9377C433EF for ; Fri, 18 Feb 2022 03:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231814AbiBRDDp (ORCPT ); Thu, 17 Feb 2022 22:03:45 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:38750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231797AbiBRDDg (ORCPT ); Thu, 17 Feb 2022 22:03:36 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9253459A64 for ; Thu, 17 Feb 2022 19:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645153401; x=1676689401; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ATRa+uik1AsrOEVB2CM3pwo/U8VGumfyuTnhTNOouXM=; b=bnEksq20TGFL5rQIL5TDLMf2qayma6itnKVItriqmCKvOsOTUI+ca/2o e7p0SExu2+GCC7tnpTiYbYjWRniLbVZDlXKEiFuhIxtITnUObZS9/4C72 yTvqj8RWbQRQHJZQ/n22ECfGYZvSZiA/XE6Tldsb2dQJY7n9dc2qGI5Xq BdVHON+9AM3tW0qIQ4UfbpQtevPA2GeXQsRaipCZN1Kp+Vk+v2jFcpuVq 5s4J5tsfWnpbBEOXUF4t5Nb6c8CyrlVI7mSGGxDt+Mj9/7WtXuwEkB2tH 82RO/nEC4XttHQXi1g5XSQ426ieQpQAco4W2aH98Uhy0I49z6p5HG13SP w==; X-IronPort-AV: E=McAfee;i="6200,9189,10261"; a="250794600" X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="250794600" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:20 -0800 X-IronPort-AV: E=Sophos;i="5.88,377,1635231600"; d="scan'208";a="635431968" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.101.109]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Feb 2022 19:03:19 -0800 From: Mat Martineau To: netdev@vger.kernel.org Cc: Geliang Tang , davem@davemloft.net, kuba@kernel.org, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 7/7] selftests: mptcp: add csum mib check for mptcp_connect Date: Thu, 17 Feb 2022 19:03:11 -0800 Message-Id: <20220218030311.367536-8-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> References: <20220218030311.367536-1-mathew.j.martineau@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Geliang Tang This patch added the data checksum error mib counters check for the script mptcp_connect.sh when the data checksum is enabled. In do_transfer(), got the mib counters twice, before and after running the mptcp_connect commands. The latter minus the former is the actual number of the data checksum mib counter. The output looks like this: ns1 MPTCP -> ns2 (dead:beef:1::2:10007) MPTCP (duration 86ms) [ OK ] ns1 MPTCP -> ns2 (10.0.2.1:10008 ) MPTCP (duration 66ms) [ FAIL ] server got 1 data checksum error[s] Fixes: 94d66ba1d8e48 ("selftests: mptcp: enable checksum in mptcp_connect.sh") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/255 Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- .../selftests/net/mptcp/mptcp_connect.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/testing/selftests/net/mptcp/mptcp_connect.sh b/tools/testing/selftests/net/mptcp/mptcp_connect.sh index cb5809b89081..5b7a40d73253 100755 --- a/tools/testing/selftests/net/mptcp/mptcp_connect.sh +++ b/tools/testing/selftests/net/mptcp/mptcp_connect.sh @@ -432,6 +432,8 @@ do_transfer() local stat_ackrx_last_l=$(get_mib_counter "${listener_ns}" "MPTcpExtMPCapableACKRX") local stat_cookietx_last=$(get_mib_counter "${listener_ns}" "TcpExtSyncookiesSent") local stat_cookierx_last=$(get_mib_counter "${listener_ns}" "TcpExtSyncookiesRecv") + local stat_csum_err_s=$(get_mib_counter "${listener_ns}" "MPTcpExtDataCsumErr") + local stat_csum_err_c=$(get_mib_counter "${connector_ns}" "MPTcpExtDataCsumErr") timeout ${timeout_test} \ ip netns exec ${listener_ns} \ @@ -524,6 +526,23 @@ do_transfer() fi fi + if $checksum; then + local csum_err_s=$(get_mib_counter "${listener_ns}" "MPTcpExtDataCsumErr") + local csum_err_c=$(get_mib_counter "${connector_ns}" "MPTcpExtDataCsumErr") + + local csum_err_s_nr=$((csum_err_s - stat_csum_err_s)) + if [ $csum_err_s_nr -gt 0 ]; then + printf "[ FAIL ]\nserver got $csum_err_s_nr data checksum error[s]" + rets=1 + fi + + local csum_err_c_nr=$((csum_err_c - stat_csum_err_c)) + if [ $csum_err_c_nr -gt 0 ]; then + printf "[ FAIL ]\nclient got $csum_err_c_nr data checksum error[s]" + retc=1 + fi + fi + if [ $retc -eq 0 ] && [ $rets -eq 0 ]; then printf "[ OK ]" fi