From 884d40f4b6eab885f9ac465943556901a240c1a5 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 13:04:37 +0200 Subject: [PATCH 1/3] Removed trailing commas from some of the JSON files to make them valid JSON These tests are not about trailing commas, so might as well make them valid JSON. Signed-off-by: Ole Herman Schumacher Elgesem --- .../acceptance/00_basics/def.json/policy_server_classes.cf.json | 2 +- tests/acceptance/01_vars/02_functions/data_expand.cf.json | 2 +- tests/acceptance/01_vars/02_functions/nth_datacontainer.cf.json | 2 +- tests/unit/data/mustache_extra.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/acceptance/00_basics/def.json/policy_server_classes.cf.json b/tests/acceptance/00_basics/def.json/policy_server_classes.cf.json index bd84880689..1cc6c60664 100644 --- a/tests/acceptance/00_basics/def.json/policy_server_classes.cf.json +++ b/tests/acceptance/00_basics/def.json/policy_server_classes.cf.json @@ -1,6 +1,6 @@ { "classes": { - "test_class_policy_server": [ "am_policy_hub" ], + "test_class_policy_server": [ "am_policy_hub" ] } } diff --git a/tests/acceptance/01_vars/02_functions/data_expand.cf.json b/tests/acceptance/01_vars/02_functions/data_expand.cf.json index 50747744be..ab7016be70 100644 --- a/tests/acceptance/01_vars/02_functions/data_expand.cf.json +++ b/tests/acceptance/01_vars/02_functions/data_expand.cf.json @@ -1,5 +1,5 @@ { "plain data": "nothing", "$(x)": "nothing again", - "$(y)": "$(nosuchvar)", + "$(y)": "$(nosuchvar)" } diff --git a/tests/acceptance/01_vars/02_functions/nth_datacontainer.cf.json b/tests/acceptance/01_vars/02_functions/nth_datacontainer.cf.json index 99251e38e4..483c0ad72a 100644 --- a/tests/acceptance/01_vars/02_functions/nth_datacontainer.cf.json +++ b/tests/acceptance/01_vars/02_functions/nth_datacontainer.cf.json @@ -7,5 +7,5 @@ "integer_2": 987654321, "string_2": "Othello? Where art thou now?", "boolean_2": false, - "null": null, + "null": null } diff --git a/tests/unit/data/mustache_extra.json b/tests/unit/data/mustache_extra.json index e76a54a688..a69973b933 100644 --- a/tests/unit/data/mustache_extra.json +++ b/tests/unit/data/mustache_extra.json @@ -61,6 +61,6 @@ }, "template": "{{#list}}{{k}}={{v}}, {{/list}}", "expected": "789=0, =true, -1=-2, " - }, + } ] } From 9ff7df8a6d248c0448b76b120ffed1389bda81c0 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 13:09:10 +0200 Subject: [PATCH 2/3] Renamed invalid JSON file to .x.json We use .x.cf as a convention for invalid files, so might as well standardize. Signed-off-by: Ole Herman Schumacher Elgesem --- tests/acceptance/01_vars/02_functions/validdata.cf | 4 ++-- .../{validdata.cf.inv.json => validdata.cf.x.json} | 0 tests/acceptance/01_vars/02_functions/validjson_strict.cf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/acceptance/01_vars/02_functions/{validdata.cf.inv.json => validdata.cf.x.json} (100%) diff --git a/tests/acceptance/01_vars/02_functions/validdata.cf b/tests/acceptance/01_vars/02_functions/validdata.cf index c25d3d0b8f..931ebe816b 100644 --- a/tests/acceptance/01_vars/02_functions/validdata.cf +++ b/tests/acceptance/01_vars/02_functions/validdata.cf @@ -19,12 +19,12 @@ bundle agent test "valid_json" string => "should appear", if => validdata(readfile("$(this.promise_filename).json", inf), "JSON"); "invalid_json" string => "should not appear", - if => validdata(readfile("$(this.promise_filename).inv.json", inf), "JSON"); + if => validdata(readfile("$(this.promise_filename).x.json", inf), "JSON"); "valid_validjson" string => "should appear", if => validjson(readfile("$(this.promise_filename).json", inf)); "invalid_validjson" string => "should not appear", - if => validjson(readfile("$(this.promise_filename).inv.json", inf)); + if => validjson(readfile("$(this.promise_filename).x.json", inf)); } ########################################################### diff --git a/tests/acceptance/01_vars/02_functions/validdata.cf.inv.json b/tests/acceptance/01_vars/02_functions/validdata.cf.x.json similarity index 100% rename from tests/acceptance/01_vars/02_functions/validdata.cf.inv.json rename to tests/acceptance/01_vars/02_functions/validdata.cf.x.json diff --git a/tests/acceptance/01_vars/02_functions/validjson_strict.cf b/tests/acceptance/01_vars/02_functions/validjson_strict.cf index 7fde5586fb..e63b7745ef 100644 --- a/tests/acceptance/01_vars/02_functions/validjson_strict.cf +++ b/tests/acceptance/01_vars/02_functions/validjson_strict.cf @@ -16,7 +16,7 @@ bundle agent check { vars: "json" string => readfile("$(this.promise_dirname)/validdata.cf.json", inf); - "invjson" string => readfile("$(this.promise_dirname)/validdata.cf.inv.json", inf); + "invjson" string => readfile("$(this.promise_dirname)/validdata.cf.x.json", inf); "mystring" string => "\"foo\""; "mynumber" string => "3.14"; "mybool" string => "true"; From 210c807cb868ef6225b22f8545d1725262173ebb Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 13:11:33 +0200 Subject: [PATCH 3/3] rules.json: Added missing comma Signed-off-by: Ole Herman Schumacher Elgesem --- .../10_files/file_select_attrs_consistent_behavior/rules.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/acceptance/10_files/file_select_attrs_consistent_behavior/rules.json b/tests/acceptance/10_files/file_select_attrs_consistent_behavior/rules.json index 352beedf05..be311e4319 100644 --- a/tests/acceptance/10_files/file_select_attrs_consistent_behavior/rules.json +++ b/tests/acceptance/10_files/file_select_attrs_consistent_behavior/rules.json @@ -1,6 +1,6 @@ [ { -"location": "/tmp/logs/tidy" +"location": "/tmp/logs/tidy", "context": "any", "action": "TIDY", "frequency": "10",