From patchwork Wed Sep 9 18:26:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 261225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 957BFC2D0E0 for ; Wed, 9 Sep 2020 18:26:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5459621D81 for ; Wed, 9 Sep 2020 18:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728405AbgIIS0m (ORCPT ); Wed, 9 Sep 2020 14:26:42 -0400 Received: from mailrelay105.isp.belgacom.be ([195.238.20.132]:5273 "EHLO mailrelay105.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbgIIS0c (ORCPT ); Wed, 9 Sep 2020 14:26:32 -0400 IronPort-SDR: bD8uNhFGVHwEVPYlwW5V5w67iMWVYwJpup2/wKODiZDjkJl4W0UA0clZ2xOG5QUebakvN+0kVg pAHcfR1bvr4gvRFOh+S5nE50W5IKd1PSD6xCcwORVr0mPm0c7dRc/TW4+8CAj9CvJ5gSGXlV5k 4FaEoD94Kb38IuHnrxv7DrhLcYw8A7G2P9zLhIgqSoYxDdSXUZfnjzfy906E1yaLU5sH/THK/F K/JzVEwplBFApBINpeijljEch+QjLiFVVgHxqs/IRk3jPCx7QwdAnV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WCNyKDUgEjI4E/EoMmAYJXKbUihBCEdYFCgTgBiCuFGYFBP4RfhASGMAS2aoJvgw2EXX6ROw8hoFYtkiShaoF6TSAYO4JpCUcZDY4oGo4mQjA3AgYKAQEDCVcBPQGKbIJGAQE Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 09 Sep 2020 20:26:30 +0200 From: Fabian Frederick To: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, Fabian Frederick Subject: [PATCH 2/3 nf] selftests: netfilter: fix nft_meta.sh error reporting Date: Wed, 9 Sep 2020 20:26:13 +0200 Message-Id: <20200909182613.23784-1-fabf@skynet.be> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When some test directly done with check_one_counter() fails, counter variable is undefined. This patch calls ip with cname which avoids errors like: FAIL: oskuidcounter, want "packets 2", got Error: syntax error, unexpected newline, expecting string list counter inet filter ^ Error is now correctly rendered: FAIL: oskuidcounter, want "packets 2", got table inet filter { counter oskuidcounter { packets 1 bytes 84 } } Signed-off-by: Fabian Frederick --- tools/testing/selftests/netfilter/nft_meta.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/netfilter/nft_meta.sh b/tools/testing/selftests/netfilter/nft_meta.sh index 17b2d6eaa2044..1f5b46542c14c 100755 --- a/tools/testing/selftests/netfilter/nft_meta.sh +++ b/tools/testing/selftests/netfilter/nft_meta.sh @@ -90,7 +90,7 @@ check_one_counter() if [ $? -ne 0 ];then echo "FAIL: $cname, want \"$want\", got" ret=1 - ip netns exec "$ns0" nft list counter inet filter $counter + ip netns exec "$ns0" nft list counter inet filter $cname fi }