Re: [PATCH 4/4] json: icmp: refresh json output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Jan 21, 2021 at 02:55:10PM +0100, Florian Westphal wrote:
> nft inserts dependencies for icmp header types, but I forgot to
> update the json test files to reflect this change.

For asymmetric JSON output, there are *.t.json.output files. Please add
the missing dependency expressions there.

In general, *.t.json files should contain JSON equivalents for rules as
they are *input* into nft. So we want them to be as close to the
introductory standard syntax comment as possible. This patch "breaks" a
few cases, e.g.:

[...]
> @@ -301,6 +301,8 @@
>                      "source-quench",
>                      "redirect",
>                      "echo-request",
> +                    "router-advertisement",
> +                    "router-solicitation",
>                      "time-exceeded",
>                      "parameter-problem",
>                      "timestamp-request",
> @@ -308,9 +310,7 @@
>                      "info-request",
>                      "info-reply",
>                      "address-mask-request",
> -                    "address-mask-reply",
> -                    "router-advertisement",
> -                    "router-solicitation"
> +                    "address-mask-reply"
>                  ]
>              }
>          }

Input is indeed sorted as prior to this patch. The reordered output is
found in icmp.t.json.output. The benefit from being picky here is minor,
but here's a better example:

[...]
> @@ -466,11 +482,11 @@
>                      "protocol": "icmp"
>                  }
>              },
> -	    "op": "==",
> +            "op": "==",
>              "right": {
>                  "set": [
> -                    2,
> -                    4,
> +                    "prot-unreachable",
> +                    "frag-needed",
>                      33,
>                      54,
>                      56

We test that icmp code values 2 and 4 are accepted. Standard syntax test
covers the asymmetric output containing the names. JSON should do the
same. OTOH, names as input is tested in the negated form of the same
test which follows this one.

Thanks, Phil



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux