From patchwork Tue Sep 11 20:14:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Phil Sutter X-Patchwork-Id: 968676 X-Patchwork-Delegate: pablo@netfilter.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netfilter-devel-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=nwl.cc Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 428x3S3vQcz9s3Z for ; Wed, 12 Sep 2018 06:15:00 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbeILBPz (ORCPT ); Tue, 11 Sep 2018 21:15:55 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:57244 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbeILBPy (ORCPT ); Tue, 11 Sep 2018 21:15:54 -0400 Received: from localhost ([::1]:36546 helo=tatos) by orbyte.nwl.cc with esmtp (Exim 4.90_1) (envelope-from ) id 1fzp3q-0000Ox-Jk; Tue, 11 Sep 2018 22:14:58 +0200 From: Phil Sutter To: Pablo Neira Ayuso Cc: netfilter-devel@vger.kernel.org Subject: [nft PATCH 4/4] tests/py: Fix JSON for icmp*.t Date: Tue, 11 Sep 2018 22:14:27 +0200 Message-Id: <20180911201427.25896-5-phil@nwl.cc> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911201427.25896-1-phil@nwl.cc> References: <20180911201427.25896-1-phil@nwl.cc> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org A recent change to ip/icmp.t and ip6/icmpv6.t did not update JSON equivalents accordingly, fix this. Fixes: 0f44d4f627535 ("proto: fix icmp/icmpv6 code datatype") Signed-off-by: Phil Sutter --- tests/py/ip/icmp.t.json | 4 +-- tests/py/ip/icmp.t.json.output | 24 ++++++++++++++++++ tests/py/ip6/icmpv6.t.json | 6 ++--- tests/py/ip6/icmpv6.t.json.output | 41 +++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 5 deletions(-) diff --git a/tests/py/ip/icmp.t.json b/tests/py/ip/icmp.t.json index 918621cb99027..4e17274587791 100644 --- a/tests/py/ip/icmp.t.json +++ b/tests/py/ip/icmp.t.json @@ -480,7 +480,7 @@ } ] -# icmp code != { 2, 4, 54, 33, 56} +# icmp code != { prot-unreachable, 4, 33, 54, 56} [ { "match": { @@ -493,7 +493,7 @@ "op": "!=", "right": { "set": [ - 2, + "prot-unreachable", 4, 33, 54, diff --git a/tests/py/ip/icmp.t.json.output b/tests/py/ip/icmp.t.json.output index 30637a1345945..e8045bb8182e0 100644 --- a/tests/py/ip/icmp.t.json.output +++ b/tests/py/ip/icmp.t.json.output @@ -35,6 +35,30 @@ } ] +# icmp code { 2, 4, 54, 33, 56} +[ + { + "match": { + "left": { + "payload": { + "field": "code", + "protocol": "icmp" + } + }, + "op": "==", + "right": { + "set": [ + "prot-unreachable", + 4, + 33, + 54, + 56 + ] + } + } + } +] + # icmp checksum { 1111, 222, 343} accept [ { diff --git a/tests/py/ip6/icmpv6.t.json b/tests/py/ip6/icmpv6.t.json index 73b9277ae9872..f6cfbf172f562 100644 --- a/tests/py/ip6/icmpv6.t.json +++ b/tests/py/ip6/icmpv6.t.json @@ -519,7 +519,7 @@ } ] -# icmpv6 code != {5, 6, 7} accept +# icmpv6 code != {policy-fail, reject-route, 7} accept [ { "match": { @@ -532,8 +532,8 @@ "op": "!=", "right": { "set": [ - 5, - 6, + "policy-fail", + "reject-route", 7 ] } diff --git a/tests/py/ip6/icmpv6.t.json.output b/tests/py/ip6/icmpv6.t.json.output index 472b2ce74133b..3c56d86d18f90 100644 --- a/tests/py/ip6/icmpv6.t.json.output +++ b/tests/py/ip6/icmpv6.t.json.output @@ -93,3 +93,44 @@ } ] +# icmpv6 code 4 +[ + { + "match": { + "left": { + "payload": { + "field": "code", + "protocol": "icmpv6" + } + }, + "op": "==", + "right": "port-unreachable" + } + } +] + +# icmpv6 code {5, 6, 7} accept +[ + { + "match": { + "left": { + "payload": { + "field": "code", + "protocol": "icmpv6" + } + }, + "op": "==", + "right": { + "set": [ + "policy-fail", + "reject-route", + 7 + ] + } + } + }, + { + "accept": null + } +] +