Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1928557ybl; Tue, 3 Dec 2019 15:10:05 -0800 (PST) X-Google-Smtp-Source: APXvYqxdRMVZoNHF0I1q1CotfriREmLetJf1ZzRNvav5Vs0WRTBSfH2yGocg6X6/2xt5ttkF9n46 X-Received: by 2002:a05:6830:1608:: with SMTP id g8mr263162otr.169.1575414604822; Tue, 03 Dec 2019 15:10:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414604; cv=none; d=google.com; s=arc-20160816; b=E87uQupJ/KlcWZzCcGq1MMGZqBq8OW7BiwqwdPJUC8WSvj7AsPcD+lteO55Y9BL4Iq kKKBMD2xsAcL6SgHyiCjYAiwqyJXxzDzhRrV/l3Z20pEIl7ZL5F3jGdEY8dGIUwXHc2U OuqcxDl4CV/ZQX4lR0MUMDXSx0QWUGOlk07ri9HENAoCxMIfdvFAlkVo+w2Lwi/ObvcI 7aTa28W9hGBf0YC38aFi0amaZz34Ixemgu8FCGLeewgvlnPCR2QM5RSE4Uq1wM8GUBPR R1+01j7z+e12o383To1GwSEhM950e8IwpqOJiF9XPU4T87DZ1BckGZy58qqt7XPhKP7y EG2A== 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=YucqkfgCzclpdlQec+xeAoHuHO82TYWoXNmPfuNtJriY7Hak+TfskA9FmpC+urAD2B Nv7/sBR+m/uZV4OnXPxvk3WP7LbSxgVwIWQTbnDK/GERYAUlPz0eBq2v/0CVNJItB2QM Xt0rCkNQnTsuDKruwemJxsQ/2cmMyCPSl4JDjv1ilP95Sgy7OKptUVGcN6bX8PFlXyBG +E/0+XF2K+/nH+Yg2bFaMj1qKRIrR7kYoVZ6z/RMbQk+gmMYQB+mbzDyuo4gtY8zZtXr AbU0rTVthv3Spp23W03HYy/qrHJ0HwRmjlua+sSZCnkqSAPcXAiO+PQG8TJo3ycVF1t+ Mr9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IBQbtPKH; 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 w131si2216113oie.47.2019.12.03.15.09.53; Tue, 03 Dec 2019 15:10:04 -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=IBQbtPKH; 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 S1728955AbfLCXIs (ORCPT + 99 others); Tue, 3 Dec 2019 18:08:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:33734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728776AbfLCWpP (ORCPT ); Tue, 3 Dec 2019 17:45:15 -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 EAFD220848; Tue, 3 Dec 2019 22:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413115; bh=1jaVvqrRRcxk8G/3Hlu0ZZYVZUHHzUghRnsT1CY3Qr8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBQbtPKHVAsxXq46WRg+J1v5gBKCuf4ASU8gvfj5r+1n17gTViFdXcHH6bImsXEPj agQLo2MKkVxYJgYjNY7Gy84qaL2OEiuLl1h41NmYYuCkFgmpkrZZPbFmJY0soOqLyZ /78dVLwzwt4sC83guVu8ZhiFAsNlzNurFOpAHmjY= 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.3 131/135] selftests: pmtu: use -oneline for ip route list cache Date: Tue, 3 Dec 2019 23:36:11 +0100 Message-Id: <20191203213045.675600377@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203213005.828543156@linuxfoundation.org> References: <20191203213005.828543156@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