From 485efcd3df69999d713031433d862147eba15cde Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 21 Nov 2023 14:22:54 +0100 Subject: tests/shell: sanitize "handle" in JSON output The "handle" in JSON output is not stable. Sanitize/normalize to zero. Adjust the sanitize code, and regenerate the .json-nft files. Signed-off-by: Thomas Haller Signed-off-by: Pablo Neira Ayuso --- tests/shell/helpers/json-sanitize-ruleset.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/shell/helpers/json-sanitize-ruleset.sh') diff --git a/tests/shell/helpers/json-sanitize-ruleset.sh b/tests/shell/helpers/json-sanitize-ruleset.sh index 270a6107..31b85cbd 100755 --- a/tests/shell/helpers/json-sanitize-ruleset.sh +++ b/tests/shell/helpers/json-sanitize-ruleset.sh @@ -6,7 +6,14 @@ die() { } do_sed() { - sed '1s/\({"nftables": \[{"metainfo": {"version": "\)[0-9.]\+\(", "release_name": "\)[^"]\+\(", "\)/\1VERSION\2RELEASE_NAME\3/' "$@" + # Normalize the "version"/"release_name", otherwise we have to + # regenerate the JSON output upon new release. + # + # Also, "handle" are not stable. Normalize them 0. + sed \ + -e '1s/^\({"nftables": \[{"metainfo": {"version": "\)[0-9.]\+\(", "release_name": "\)[^"]\+\(", "\)/\1VERSION\2RELEASE_NAME\3/' \ + -e '1s/"handle": [0-9]\+\>/"handle": 0/g' \ + "$@" } if [ "$#" = 0 ] ; then -- cgit v1.2.3