Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1901027ybl; Tue, 3 Dec 2019 14:40:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzWI+fp2151lehPFsZGxgtqofhauOEVGRfav7NhpzGLN5iSoWT+UnAfxrZ0ngoGh+pHCia6 X-Received: by 2002:a05:6830:1458:: with SMTP id w24mr206299otp.206.1575412855170; Tue, 03 Dec 2019 14:40:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575412855; cv=none; d=google.com; s=arc-20160816; b=ZNCqYITYwPMwGAajBI9evPPvvglkFmQbeiV7wwqyjFpQ5SVKt3iCk6vDd9DdZb0CNq siHmRyRofcCqc9cmtiUMq6ooynr+MWUm+xvifPHVIjkr+GOotBQUU3MnXbrXoRa/tt4F 6inqVZgEG1hMGpSudfVyNkhwzy2sJRUEDbCP4hqbax5501bNXYP/backPLkl5GOxT0Wq oDGXTuFty/Chibk0pMw50Yt5V66Ktq9yCetmKvicCgBtLdLkKCMTBVvi8odPH2YtXX+2 6u5hlYpLq+1PCZtbR8AYpxvaKXRE/5BOdTzHRjz5RR/BtI4XaCJUip7WCthXUMXbj6Xp sOXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6g2wGktr98iC3MYdUagVsRzCinXSGe9mRJSMOE6VZ8s=; b=EPo70T8wFumYFf6P8nGQUtAFDkv7q81XgfIFNmcXqT8ufYhaao6R7Be7XCDPJ0bYYP y5pPaLULb4h67k1awydXg6eNSpGIK4c0eOXSyVoQIgmKb1tpB/VD3KkMJ0wqAjX48d6I h44SmcAu6RQNpDhass+eOqjKZPfUss0/eHlp/CiUVL2FQ0sJNitwp07QbZX/bHYESlyQ d54LldejzUx+qD3nq5zjgwU7QNOF9V6HzAG1CaLvT9TYABwYw2lkshg62d5ukMCtbInR Cg4ynKB7+YCgaKPlGxJt7V6p3uT3FDIx7dMn3O7YHe5fN13ZpUvoASiv0pmFw5vxEzg4 rbRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eo/6VkAp"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si2322580otp.181.2019.12.03.14.40.43; Tue, 03 Dec 2019 14:40:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="eo/6VkAp"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727708AbfLCWir (ORCPT + 99 others); Tue, 3 Dec 2019 17:38:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:48212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728064AbfLCWip (ORCPT ); Tue, 3 Dec 2019 17:38:45 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 798C120684; Tue, 3 Dec 2019 22:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575412724; bh=1jaVvqrRRcxk8G/3Hlu0ZZYVZUHHzUghRnsT1CY3Qr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eo/6VkApQM3W+32KTtxQv+btDmo9RPDJXGG19iFlHsltuGZunqapgCIxsVATN852Y UDP/bRg/heI0WUQY1TVGed0cg3WRYwclKEWTl/uXyJvEoAr9PXCAgvxrVlSx9Sd5V/ maavT0PZuvU8VJS5dlhuERyXUtobbTqFMHHHjFUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thadeu Lima de Souza Cascardo , Stefano Brivio , "David S. Miller" Subject: [PATCH 5.4 38/46] selftests: pmtu: use -oneline for ip route list cache Date: Tue, 3 Dec 2019 23:35:58 +0100 Message-Id: <20191203212801.005375736@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203212705.175425505@linuxfoundation.org> References: <20191203212705.175425505@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thadeu Lima de Souza Cascardo [ Upstream commit 2745aea6750ff0d2c48285d25bdb00e5b636ec8b ] Some versions of iproute2 will output more than one line per entry, which will cause the test to fail, like: TEST: ipv6: list and flush cached exceptions [FAIL] can't list cached exceptions That happens, for example, with iproute2 4.15.0. When using the -oneline option, this will work just fine: TEST: ipv6: list and flush cached exceptions [ OK ] This also works just fine with a more recent version of iproute2, like 5.4.0. For some reason, two lines are printed for the IPv4 test no matter what version of iproute2 is used. Use the same -oneline parameter there instead of counting the lines twice. Fixes: b964641e9925 ("selftests: pmtu: Make list_flush_ipv6_exception test more demanding") Signed-off-by: Thadeu Lima de Souza Cascardo Acked-by: Stefano Brivio Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/net/pmtu.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/tools/testing/selftests/net/pmtu.sh +++ b/tools/testing/selftests/net/pmtu.sh @@ -1249,8 +1249,7 @@ test_list_flush_ipv4_exception() { done run_cmd ${ns_a} ping -q -M want -i 0.1 -c 2 -s 1800 "${dst2}" - # Each exception is printed as two lines - if [ "$(${ns_a} ip route list cache | wc -l)" -ne 202 ]; then + if [ "$(${ns_a} ip -oneline route list cache | wc -l)" -ne 101 ]; then err " can't list cached exceptions" fail=1 fi @@ -1300,7 +1299,7 @@ test_list_flush_ipv6_exception() { run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst_prefix1}${i}" done run_cmd ${ns_a} ping -q -M want -i 0.1 -w 1 -s 1800 "${dst2}" - if [ "$(${ns_a} ip -6 route list cache | wc -l)" -ne 101 ]; then + if [ "$(${ns_a} ip -oneline -6 route list cache | wc -l)" -ne 101 ]; then err " can't list cached exceptions" fail=1 fi