Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1406923lqp; Mon, 15 Apr 2024 05:57:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqeUzboX6UDFSCYC8nTupKMZQtqCHVqGTommxT06ZIDHw7lHhkseESzfAy0edQ+PddFY4pwSuUFilwUXUPy2QeB6b7OaDGNBCC4Y3Waw== X-Google-Smtp-Source: AGHT+IG7RuRo9Rj3yOe/87wKO5UGivNAAr50vuPE0IEByzpWyWW1bIeqsjbkvsXjZ3o8zNwA8Avc X-Received: by 2002:a05:622a:606:b0:434:eb3c:1b52 with SMTP id z6-20020a05622a060600b00434eb3c1b52mr12650693qta.32.1713185873756; Mon, 15 Apr 2024 05:57:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713185873; cv=pass; d=google.com; s=arc-20160816; b=fBaGc4SgnFOrJGrzlepNs0DzH650pEAx9VeHhmbQTMfk+KnZ5pxRlZgG6ohrOyPXbK KL3KVsx/tTlp/0xuh69PiBnH8eMcMCFvXwtz/Wge8heYHtFY/8+VJpUOnjxpS0abvCqn oq5leULiAq21Anq0VavRUEkIM8QLK3wfKXoz5D47kHbNRooCzoUiQQCoflNR99UjS1pt 6uh8jr+EPOF1Wb344x5vzBes+iJqo8Std/6Uh8PGZMKXbYa3hqGj4i/tWZVuEBbucLR3 Dgq2M06Bi0s70aVD803vNpXX4mA55xEQu5Qx9XoLg0D2fWbQlO5vHC7g2MmV4U/Ezc2n 7ylw== ARC-Message-Signature: i=2; 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=p9dlsSxzlUXwfeOgL0Q/YTdva1qwP6JdcJnDZqixIvQ=; fh=GRXjSm+jfPP1PuQ2qh5w1/fdW+ph2t6Nsz4fBb/3Pfo=; b=WO5o7SOfyS4c18mGyNebWdH8qKa1luxfI/UNWcb7a1oa35fbI3px3t9g5mAD2sahip 6EkKObg+djGfFk61ftS3hxN1sRHpFiyse8iXNGYtqir7/fxjLuW94v6wzY7f4/oP/TrG msMenaEKIszVhbgo7pwSsYw4s/60ytfoeUk3ehyN0J2AUpJlM+6FcRAUgIQq2TLcy31e Suc/U/k+oI9CSX5wy5cWw9pSXYebkCh9cvxY5e4liNV/IZRqFmMogzBuIZO2ye3kEZ14 7su+8jsDkzPgh2vAp5UC/H+Pg3CRa2QTKh+cSnZ/g+sSR/0KHoMxLNhFwoMBKDl96o3h BJhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=fpj34lVE; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-145131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d17-20020a05622a05d100b004349bccdafdsi10199640qtb.804.2024.04.15.05.57.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=fpj34lVE; arc=pass (i=1 spf=pass spfdomain=denx.de dkim=pass dkdomain=denx.de dmarc=pass fromdomain=denx.de); spf=pass (google.com: domain of linux-kernel+bounces-145131-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145131-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7C59D1C212CA for ; Mon, 15 Apr 2024 12:57:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 920D4127B7A; Mon, 15 Apr 2024 12:50:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b="fpj34lVE" Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 52EC4126F04; Mon, 15 Apr 2024 12:50:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.62.61 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713185413; cv=none; b=l4nmvzV0Td8Lix07D5Xr0Bnv8daSuDMFhlB33DnFjGFfwfaj1RD9IP7KUojTvddvY1ySE3+Focz94haVxh7RE0wsLf+pcQFd+Frb8+GwhUhQWby4qXi9E/2HA3LQ2rQUBpdxTWajkke1fKuWBtIfqO2xkIEmJGhKG4EPgZq05gc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713185413; c=relaxed/simple; bh=z0/VNucQ2b5gMFfyo65SQ3j5gsYjeZQte4ulxbPVM3M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=c1+U6hH1185Wa6RlqZ04nKYpNEfBrYrVncrHGXY5vN71VmBRJ4mXFeXEp6gj4K+xi2aqw6aVfz8HriXGzHlFBnD3JGSOSOr/cY8I9lLo9wmP3z41KTSESGJOkUM8hlmytjxjYsrjMauAQMjqHMDTjNzl5spqqCwNncBs6Af/0UI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de; spf=pass smtp.mailfrom=denx.de; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.b=fpj34lVE; arc=none smtp.client-ip=85.214.62.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=denx.de Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id D6C3B88198; Mon, 15 Apr 2024 14:50:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1713185405; bh=p9dlsSxzlUXwfeOgL0Q/YTdva1qwP6JdcJnDZqixIvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fpj34lVEyC2w+99Iu91s8I5Ba4wXSY7h3bMTpFnEAa9CcRJV2ql+3XiHYwjiaOgoV YrtaFgBWk1dTye4q3/pu3nN+8SrAZ1CyTpKFHCgQvuy+HsWL5NCPTzgVfZMA9KiaYr J7fT6CkQyOpk0SYdgf5ixTXMeQDr9mEXbZ9XkdoI3E8/aXuvpdyif5mxVqCnZvbVZE rCtNYRj6IBtKIOQGOtOTLAKnOlOnb6YG4KBvYIqvIoPyfkjIpFZ8VKK1Obdwq8tdsr 5m8g0NnPQX0VZmjF2Zi0NXpPDhoRvbmT5GOr9NmU5b+2d7ENWeH3apFp9Bqc0IzDQ+ vDw+sgy8cYmIg== From: Lukasz Majewski To: netdev@vger.kernel.org, Paolo Abeni Cc: Andrew Lunn , Eric Dumazet , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Oleksij Rempel , Tristram.Ha@microchip.com, Sebastian Andrzej Siewior , Ravi Gunasekaran , Simon Horman , Nikita Zhandarovich , Murali Karicheri , Jiri Pirko , Dan Carpenter , Ziyang Xuan , Shigeru Yoshida , "Ricardo B. Marliere" , linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [net-next PATCH v5 3/4] test: hsr: Extract version agnostic information from ping command output Date: Mon, 15 Apr 2024 14:49:27 +0200 Message-Id: <20240415124928.1263240-4-lukma@denx.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240415124928.1263240-1-lukma@denx.de> References: <20240415124928.1263240-1-lukma@denx.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Current code checks if ping command output match hardcoded pattern: "10 packets transmitted, 10 received, 0% packet loss,". Such approach will work only from one ping program version (for which this test has been originally written). This patch address problem when ping with different summary output like "10 packets transmitted, 10 packets received, 0% packet" is used to run this test - for example one from busybox (as the test system runs in QEMU with rootfs created with buildroot). The fix is to modify output of ping command to be agnostic to ping version used on the platform. Signed-off-by: Lukasz Majewski --- tools/testing/selftests/net/hsr/hsr_common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/hsr/hsr_common.sh b/tools/testing/selftests/net/hsr/hsr_common.sh index 822165391573..9ae2723f6a48 100644 --- a/tools/testing/selftests/net/hsr/hsr_common.sh +++ b/tools/testing/selftests/net/hsr/hsr_common.sh @@ -64,7 +64,8 @@ do_ping_long() fi VAL="$(echo $OUT | cut -d' ' -f1-8)" - if [ "$VAL" != "10 packets transmitted, 10 received, 0% packet loss," ] + SED_VAL="$(echo ${VAL} | sed -r -e 's/([0-9]{2}).*([0-9]{2}).*[[:space:]]([0-9]+%).*/\1 transmitted \2 received \3 loss/')" + if [ "${SED_VAL}" != "10 transmitted 10 received 0% loss" ] then echo "$netns -> $connect_addr ping TEST [ FAIL ]" echo "Expect to send and receive 10 packets and no duplicates." -- 2.20.1