]> git.ipfire.org Git - thirdparty/nftables.git/commit
tests/shell: check and generate JSON dump files
authorThomas Haller <thaller@redhat.com>
Tue, 14 Nov 2023 16:08:27 +0000 (17:08 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 15 Nov 2023 11:28:44 +0000 (12:28 +0100)
commitc9caa99c52752907509584b7165ad6180764d87d
tree4200593f942a7e86a551afda5f4e85885aeda307
parentb04512cf30de1ba6657facba5ebe2321e17c2727
tests/shell: check and generate JSON dump files

The rules after a successful test are good opportunity to test
`nft -j list ruleset` and `nft -j --check`. This quite possibly touches
code paths that are not hit by other tests yet.

The only downside is the increase of the test runtime (which seems
negligible, given the benefits of increasing test coverage).

Future commits will generate and commit those ".json-nft" dump files.

"DUMPGEN=y" will, like before, regenerate only the existing
"*.{nodump,nft,json-nft}" files (unless a test has none of the 3 files,
in which case they are all generated and the user is suggested to commit
the correct ones). Now also "DUMPGEN=all" is honored, that will generate
all 3 files, regardless of whether they already existed. That is useful
if you start out with a test that only has a .nft file, and then you
want to generate a .json-nft file too.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
tests/shell/helpers/json-sanitize-ruleset.sh [new file with mode: 0755]
tests/shell/helpers/test-wrapper.sh
tests/shell/run-tests.sh