Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7106789ybc; Thu, 28 Nov 2019 11:01:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwDYrty8YoW9rm0EEg27KO/URtexqqPNu5+QPLtoCdYyN0Gy6WIJ/E3Gtg3GfMGbG/fkcr8 X-Received: by 2002:a17:906:394:: with SMTP id b20mr32019833eja.188.1574967700534; Thu, 28 Nov 2019 11:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574967700; cv=none; d=google.com; s=arc-20160816; b=zHXEwmzbGwmYLa6f/BZrjcJ5+VJksWsve/by4mIBDqh1k5E7Vrtan5bOfSafzCxPtf Hic9398RkWUgXIJ0TqkCVm2zRQ3h/wfHTqEe6XzuvsCotVhi8oe8247rT6g30sy+R4DJ o+gz9HtMSlTwHOamOeS+nCcKUD9KnNYzsL0IGbFYUPnKXnNntKLXCPjjkfIpW3UMn2kE ehnFHve/hrjWkXBrjdww8RIE05+g6Ra1jjSKSOCGnybdqC2HLMxHYQ/TDNURCfdWZ5uc R33Mi27jHwvA2jYVyaJUM1S4+W8lWAWs8GXT5Add/yYEFAps8nfLj1NVKHmiTGP/Ha1K WoYA== 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 :message-id:date:subject:cc:to:from; bh=iWc8wpslJQylCTZ3HBzjf6zWYQRvp7eHPVH0KUgOcfU=; b=03hdWkf+EMcgqoEbhqAQi8nNdYCSrwCHZU+y2u7JE2HOn/09zSca73ZM0adl7Z3Ftj tHO6ssXjTUkCZtUv+rta3yno4viYc0040emc22IoGvbH0eat9NZ5Ur4to2s7Yj/TqlEz k7GFGCLVOkGvrGLm0i25w/HZCUHvJxjIyfUlcTiPrA4VuEC/tcybEAdTHLqUlVVK7WJN AHd6U1CEUBIHivWkUXTI9UFzA1DNvCPsB/3BXUCmHajJvDMN44HhR8h0qQtNEXZZQz8N xbT38pGjqdEWZ/+bhNcc6omTpcyfJ72jBwxLiQP0Al/zg8RGGVNV5R0t7qxQ1mMrz133 FLug== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si11928984eju.106.2019.11.28.11.00.54; Thu, 28 Nov 2019 11:01:40 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726710AbfK1S70 (ORCPT + 99 others); Thu, 28 Nov 2019 13:59:26 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:49938 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbfK1S7Z (ORCPT ); Thu, 28 Nov 2019 13:59:25 -0500 Received: from [189.110.51.181] (helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iaP0d-0004aS-Kx; Thu, 28 Nov 2019 18:59:24 +0000 From: Thadeu Lima de Souza Cascardo To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, davem@davemloft.net, sbrivio@redhat.com Subject: [PATCH] selftests: pmtu: use -oneline for ip route list cache Date: Thu, 28 Nov 2019 15:58:06 -0300 Message-Id: <20191128185806.23706-1-cascardo@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Thadeu Lima de Souza Cascardo --- tools/testing/selftests/net/pmtu.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/net/pmtu.sh b/tools/testing/selftests/net/pmtu.sh index ab367e75f095..d697815d2785 100755 --- 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 -- 2.20.1