summaryrefslogtreecommitdiffstats
path: root/tests/shell/helpers/json-sanitize-ruleset.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/shell/helpers/json-sanitize-ruleset.sh')
-rwxr-xr-xtests/shell/helpers/json-sanitize-ruleset.sh9
1 files changed, 8 insertions, 1 deletions
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