From patchwork Wed Jan 25 10:47:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 48109 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp211361wrn; Wed, 25 Jan 2023 03:00:34 -0800 (PST) X-Google-Smtp-Source: AK7set8jMTind3XpK4hr+OXVtfVOVRX6X5VWOc4ZNOm8IYCuUlvxGKkfkD9uNFYUiZbVIOg++jh9 X-Received: by 2002:a17:90b:4f43:b0:22b:fd18:f333 with SMTP id pj3-20020a17090b4f4300b0022bfd18f333mr3869221pjb.40.1674644434477; Wed, 25 Jan 2023 03:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674644434; cv=none; d=google.com; s=arc-20160816; b=qsTKoz9XUiIDHO5dt7Cg8J/G7O+R1FqbD06FQE21Zj+AriH0WrHiw9YPkC8f/8N0B7 7o0fwNN++XU872eE6pKgVxAtOwOjLp9QmZ38qfHGnQtGIDQg6PzgIae8bSAq8wHTdGR0 HpkHWe0vJ19cqaP49xD090GTbzK8EuvbL1RW6Jr+CK9JCV+km2jE1qOy0ZMJH7U4TXgZ TAYBYnQVfsCTkSi28zNbXN1oA1xZx6Co85jvzqUzN/gYaq6M1wy6BYoQJ4H6WXKQYZ2A GuxkC6sYptJHy3AQwA7kcfboy79WFnE1TrwdR8mkY4muqxD+XkvMKtrSlKQvz0Y6PleI 2ddw== 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=3qynjSOc6nz4Nf6cQvYVVmdAvys7aqe1bFN8sKVYTz8=; b=Hseji+w2eg5akPtTiELjb6XQ4rIDUf6gqknfBNO1kaPUMyyumDnx2GIHYy26GexNba 10HDcNku0s3p2wKVreGAurBlWe1webT+4SLh+Qlh1dumjz2395rkzifbAYDmquRAKYzi ut6shdVx5EFg1L9JnK77XROSj1Gj0ln1nekppOrXwapPKBJuirmA9OI0bt18KrEnwXr+ cei2p3voM+uxuw34HV0OZH5sLuG46dZjP0Ui7mvP0yCkb9Q8KpdKYFpilCjLSdFTY98k GLVY096bKA3p4IEXKdo/c6EFv2aPJEDcanZyTKf5mq9WhCjf1sAqrVkiZOD/EnAf/UV7 +LLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@tessares.net header.s=google header.b=mvgkbs7E; 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=QUARANTINE sp=QUARANTINE 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 i13-20020a17090adc0d00b00225f9fff787si1652549pjv.146.2023.01.25.03.00.20; Wed, 25 Jan 2023 03:00:34 -0800 (PST) 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=mvgkbs7E; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tessares.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235830AbjAYKtf (ORCPT + 99 others); Wed, 25 Jan 2023 05:49:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235731AbjAYKtO (ORCPT ); Wed, 25 Jan 2023 05:49:14 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F708577E5 for ; Wed, 25 Jan 2023 02:48:13 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso961542wmq.5 for ; Wed, 25 Jan 2023 02:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tessares.net; s=google; 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=3qynjSOc6nz4Nf6cQvYVVmdAvys7aqe1bFN8sKVYTz8=; b=mvgkbs7E687JKkTLyPJRpf8Xfh8mSV2+GLd1lNG7xZ/hquVAxxx/ZdarKyszSnvPE+ DBXn/W4v1I2+NKYIqjUPOOorRGG+Kdonx9kWv7PkfHwHg8NakgZhDD5UooSRECRGQDeX tBgY//8TJ1ncc4A1nGHSGMuHVvW6FLrQN/FaPsJSA9xHji44P9/C6IYa9KIuTTDWhkdi ipYwsJGijh9sT/4dflQh12wTP9sf7+iiKdPef3xIM6Sq9EKHcKd3pp+LiAXEFUUKavm6 zXDZMFo+ywL3NJEM4wqelJNC2vv/n2y768gbUPChpXzC/EJ+n0NV8K2eInQsnFhps1Sc BqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3qynjSOc6nz4Nf6cQvYVVmdAvys7aqe1bFN8sKVYTz8=; b=0TxavutZULPlu8YOsMbQxlRHb8r/j5Kni/ZKWnHjqVzl4t+Xu0V4p5nHdruDw+kD5l ukMx3Gg1v2VkQUfD1M7oCanjm4r2aNy2YpLKgxjG86bHx7+7djVpR6mXXcNAI9ivQdpt 8cnl0J1z2++c67tQiBKKfoAYJQRGHXQ6Y6NQAsDhOhkZBx85k9BGQifDTylAaqxlK0TG hbw+mmEgq1j/XMZk4WYs4ZiF1RBrwxV6QX0FLh5rUlUuZKohhr33piENSkdkhL4zyx91 yDh+BzePJa2tnuSgzH/cdlO0oY4uF7QJvt3Mb6kKpN1H8kzKIIaFItCVvyvslLiTjrZ2 OLZg== X-Gm-Message-State: AFqh2kovpHcEFctf11NK+/iSzKMlpnvzv6VfOjiw4Wd0z6bVB77qbDc0 L+jbrv5Mt8cQLrt3bTzFtUW2Eg== X-Received: by 2002:a05:600c:1713:b0:3da:fd90:19dd with SMTP id c19-20020a05600c171300b003dafd9019ddmr31052393wmn.26.1674643686984; Wed, 25 Jan 2023 02:48:06 -0800 (PST) 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 r1-20020a05600c424100b003d9a86a13bfsm1423692wmm.28.2023.01.25.02.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 02:48:06 -0800 (PST) From: Matthieu Baerts Date: Wed, 25 Jan 2023 11:47:28 +0100 Subject: [PATCH net-next 8/8] selftests: mptcp: userspace: avoid read errors MIME-Version: 1.0 Message-Id: <20230123-upstream-net-next-pm-v4-v6-v1-8-43fac502bfbf@tessares.net> References: <20230123-upstream-net-next-pm-v4-v6-v1-0-43fac502bfbf@tessares.net> In-Reply-To: <20230123-upstream-net-next-pm-v4-v6-v1-0-43fac502bfbf@tessares.net> To: Mat Martineau , Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shuah Khan Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2122; i=matthieu.baerts@tessares.net; h=from:subject:message-id; bh=6MOG1ZEazJbpV3v3EchrO329puIDO6dd5lQxjWDGRMo=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBj0QjdROHosjdgthf7sJ7fwTT7T291txcJlOXdMy83 0OLZ1G6JAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCY9EI3QAKCRD2t4JPQmmgc7csEA CbPf+IRNTcrGZQC9QI7Yjf/aCMXKOxRtzRhttRiohq7mKvymkfTT4g70DdGz+uRLKD+cK9TkMqd2mv HVH3WfEd+OSehw0Vk/yr3fYuXQewl8dVbg+DA1EagE3EDeUJ0Ztm/y5N2f7Zud34C5b1mWqKShx+dF wg1ybzUvvQu+GCkGL/SqRVNkVSK37EfnYB65gIikXED5CDt/I+wqCi/cOQcmFpjk7/Pfdaj4uhS2mP A/6iMw32sesJ2BMqCVuyCDRxPCOPEiFD22/45KINjXTfVOZGtBYchOynwxDxpTGsOnrWANUWay21xs 7KJ7eIIXLiv+OJM+6+8Fyjl6vW2h5z1msYmcBZjmJMdKFFAGvnx6XGVji524YO3uQECONQolvJoItm Op86B/1iTSVmGpwB7wJJNCTcgWuEB9+GSbRWYyfuKPWgf1YpK4AEHBOCJn74qFvXd0qhHZ8bzKZ6D1 0O/nrR+CJGb4HlMQCrzrr6Xe0KFPfx7UMZg/RiCG9APdhw3Viamh03zD8WfI1Bs0Ocb5x/0K9dwW48 22UiCsU1M11LYEkINUw65f6XsqPO/uwWh7fGmXFHzM9gCg0HeHRi75RV1ztTqey69uMSk5d0aDKuRp RvfrKxDXEYcTaQAG+/nA/RXn78aCdfwHL6oHShYKJXZMf/Mm/6OLUsCoaNNA== 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_NONE, SPF_HELO_NONE,SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755991962671777494?= X-GMAIL-MSGID: =?utf-8?q?1755991962671777494?= During the cleanup phase, the server pids were killed with a SIGTERM directly, not using a SIGUSR1 first to quit safely. As a result, this test was often ending with two error messages: read: Connection reset by peer While at it, use a for-loop to terminate all the PIDs the same way. Also the different files are now removed after having killed the PIDs using them. It makes more sense to do that in this order. Reviewed-by: Mat Martineau Signed-off-by: Matthieu Baerts --- tools/testing/selftests/net/mptcp/userspace_pm.sh | 32 +++++++++-------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/tools/testing/selftests/net/mptcp/userspace_pm.sh b/tools/testing/selftests/net/mptcp/userspace_pm.sh index 259382ad552c..66c5be25c13d 100755 --- a/tools/testing/selftests/net/mptcp/userspace_pm.sh +++ b/tools/testing/selftests/net/mptcp/userspace_pm.sh @@ -50,6 +50,9 @@ print_title() kill_wait() { + [ $1 -eq 0 ] && return 0 + + kill -SIGUSR1 $1 > /dev/null 2>&1 kill $1 > /dev/null 2>&1 wait $1 2>/dev/null } @@ -58,32 +61,21 @@ cleanup() { print_title "Cleanup" - rm -rf $file $client_evts $server_evts - # Terminate the MPTCP connection and related processes - if [ $client4_pid -ne 0 ]; then - kill -SIGUSR1 $client4_pid > /dev/null 2>&1 - fi - if [ $server4_pid -ne 0 ]; then - kill_wait $server4_pid - fi - if [ $client6_pid -ne 0 ]; then - kill -SIGUSR1 $client6_pid > /dev/null 2>&1 - fi - if [ $server6_pid -ne 0 ]; then - kill_wait $server6_pid - fi - if [ $server_evts_pid -ne 0 ]; then - kill_wait $server_evts_pid - fi - if [ $client_evts_pid -ne 0 ]; then - kill_wait $client_evts_pid - fi + local pid + for pid in $client4_pid $server4_pid $client6_pid $server6_pid\ + $server_evts_pid $client_evts_pid + do + kill_wait $pid + done + local netns for netns in "$ns1" "$ns2" ;do ip netns del "$netns" done + rm -rf $file $client_evts $server_evts + stdbuf -o0 -e0 printf "Done\n" }