summaryrefslogtreecommitdiffstats
path: root/tests/shell/helpers/json-diff-pretty.sh
Commit message (Collapse)AuthorAgeFilesLines
* tests/shell: prettify JSON in test output and add helperThomas Haller2023-11-221-0/+17
- add helper script "json-pretty.sh" for prettify/format JSON. It uses either `jq` or a `python` fallback. In my tests, they produce the same output, but the output is not guaranteed to be stable. This is mainly for informational purpose. - add a "json-diff-pretty.sh" which prettifies two JSON inputs and shows a diff of them. - in "test-wrapper.sh", after the check for a .json-nft dump fails, also call "json-diff-pretty.sh" and write the output to "ruleset-diff.json.pretty". This is beside "ruleset-diff.json", which contains the original diff. Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>