]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests/shell: use generated ruleset for `nft --check`
authorThomas Haller <thaller@redhat.com>
Fri, 24 Nov 2023 12:45:53 +0000 (13:45 +0100)
committerFlorian Westphal <fw@strlen.de>
Sun, 3 Dec 2023 11:36:01 +0000 (12:36 +0100)
commitfd3f09419513805cc0d90120401aa3d2d3f35eed
tree68fdd372d178394e93eb288d7709f6d92b99befe
parent26723202e600604ab7cf48915507cfcb7a313620
tests/shell: use generated ruleset for `nft --check`

The command `nft [-j] list ruleset | nft [-j] --check -f -` should never
fail. "test-wrapper.sh" already checks for that.

However, previously, we would run check against the .nft/.json-nft
files. In most cases, the generated ruleset and the files in git are
identical. However, when they are not, we (also) want to run the check
against the generated one.

This means, we can also run this check every time, regardless whether a
.nft/.json-nft file exists.

If the .nft/.json-nft file is different from the generated one, (because
a test was skipped or because there is a bug), then also check those
files. But this time, any output is ignored as failures are expected
to happen. We still run the check, to get additional coverage for
valgrind or santizers.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/helpers/test-wrapper.sh