Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6d3b9ea
Removed trailing commas from some of the JSON files to make them vali…
olehermanse Apr 30, 2026
0a81fda
Renamed invalid JSON file to .x.json
olehermanse Apr 30, 2026
b172f51
rules.json: Added missing comma
olehermanse Apr 30, 2026
d1b50d8
Renamed unit test invalid policy files to use .x.cf suffix
olehermanse Apr 30, 2026
0409519
Added missing commas
olehermanse Apr 30, 2026
cf8a62e
Renamed plucked.cf.sub to plucked.sub.cf
olehermanse Apr 30, 2026
545a134
Renamed default.cf.sub and dcs.cf.sub to .sub.cf
olehermanse Apr 30, 2026
b488176
Added missing semicolon
olehermanse Apr 30, 2026
307bf42
Renamed one invalid JSON to .x.json
olehermanse Apr 30, 2026
e987551
Added test for invalid syntax in macros
olehermanse May 4, 2026
db1ec60
testall: Skipped .sub.x.cf files
olehermanse May 4, 2026
205742d
Renamed failsafe test sub policy file
olehermanse May 4, 2026
0515b6f
Cleaned up macro tests
olehermanse May 4, 2026
dd4d51c
cfengine format tests/acceptance/00_basics/macros/
olehermanse May 4, 2026
37b623f
tests: Added comment to empty policy file for cf-execd code test
olehermanse May 6, 2026
34d4108
tests: Changed ifvarclass to if in several tests and examples
olehermanse May 6, 2026
cf18b19
tests: Renamed vars_multiple_types to .x.cf
olehermanse May 6, 2026
1b4cf39
tests: Removed unused test file
olehermanse May 6, 2026
cd63781
tests: Renamed wrong-bundle-type.cf.sub to .sub.x.cf
olehermanse May 6, 2026
6fc3759
examples: Made sense of augment.cf example
olehermanse May 6, 2026
a223a33
Ran make pluck (for 3.27)
olehermanse May 19, 2026
802f0f7
fix: ci/install.sh should also generate a hostkey with cf-key
craigcomstock Apr 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ if [ ! -n "$TERMUX_VERSION" ]; then
fi

$GAINROOT make install
$GAINROOT /var/cfengine/bin/cf-key # to generate the hostkey
2 changes: 1 addition & 1 deletion contrib/masterfiles/git-failsafe.cf
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bundle agent git_update
perms => u_m("755"),
depth_search => u_recurse_basedir("inf"),
action => u_immediate,
ifvarclass => "hpux";
if => "hpux";

"/usr/local/bin"
comment => "Ensure cfengine binaries were copied to /usr/local/bin",
Expand Down
11 changes: 6 additions & 5 deletions examples/augment.cf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ bundle common def
{
vars:
# Only define this variable if it is not yet defined.
"example_augment_string_override"
unless => isvariable("example_augment_string_override");
"example_augment_string"
string => "fallback value when not defined in def.json",
unless => isvariable("example_augment_string");

# Define this variable regardless if it has been set in def.json
"example_augment_list_override"
Expand All @@ -18,16 +19,16 @@ bundle agent main
reports:
"Def var: '$(def_vars)'";

"def.example_augment_string_override = '$(def.example_augment_string_override)'";
"def.example_augment_string = '$(def.example_augment_string)'";
"def.example_augment_list_override = '$(def.example_augment_list_override)'";
"def.example_augment_structured_override[key1] = '$(def.example_augment_structured_override[key1])'";
}
#+begin_src example_output
#@ ```
#@ R: Def var: 'default:def.example_augment_structured_override'
#@ R: Def var: 'default:def.example_augment_string_override'
#@ R: Def var: 'default:def.example_augment_string'
#@ R: Def var: 'default:def.example_augment_list_override'
#@ R: def.example_augment_string_override = 'defined in def.json'
#@ R: def.example_augment_string = 'defined in def.json'
#@ R: def.example_augment_list_override = 'defined'
#@ R: def.example_augment_list_override = 'in'
#@ R: def.example_augment_list_override = 'bundle'
Expand Down
12 changes: 6 additions & 6 deletions examples/classfilterdata_array_of_objects.cf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ bundle agent __main__
vars:
"original"
data => '[
{ "file": "/tmp/foo", "ifvarclass": "role_1" },
{ "file": "/tmp/bar", "ifvarclass": "role_2" },
{ "file": "/tmp/baz", "ifvarclass": "(role_1|role_2)" }
{ "file": "/tmp/foo", "if": "role_1" },
{ "file": "/tmp/bar", "if": "role_2" },
{ "file": "/tmp/baz", "if": "(role_1|role_2)" }
]';

"filtered"
data => classfilterdata("original", "array_of_objects", "ifvarclass");
data => classfilterdata("original", "array_of_objects", "if");

reports:
"Filtered data: $(with)"
Expand All @@ -26,11 +26,11 @@ bundle agent __main__
#@ R: Filtered data: [
#@ {
#@ "file": "/tmp/bar",
#@ "ifvarclass": "role_2"
#@ "if": "role_2"
#@ },
#@ {
#@ "file": "/tmp/baz",
#@ "ifvarclass": "(role_1|role_2)"
#@ "if": "(role_1|role_2)"
#@ }
#@ ]
#@ ```
Expand Down
12 changes: 6 additions & 6 deletions examples/classfilterdata_object_of_objects.cf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ bundle agent __main__
vars:
"original"
data => '{
"/tmp/foo": { "ifvarclass": "role_1" },
"/tmp/bar": { "ifvarclass": "role_2" },
"/tmp/baz": { "ifvarclass": "(role_1|role_2)" }
"/tmp/foo": { "if": "role_1" },
"/tmp/bar": { "if": "role_2" },
"/tmp/baz": { "if": "(role_1|role_2)" }
}';

"filtered"
data => classfilterdata("original", "object_of_objects", "ifvarclass");
data => classfilterdata("original", "object_of_objects", "if");

reports:
"Filtered data: $(with)"
Expand All @@ -25,10 +25,10 @@ bundle agent __main__
#@ ```
#@ R: Filtered data: {
#@ "/tmp/bar": {
#@ "ifvarclass": "role_2"
#@ "if": "role_2"
#@ },
#@ "/tmp/baz": {
#@ "ifvarclass": "(role_1|role_2)"
#@ "if": "(role_1|role_2)"
#@ }
#@ }
#@ ```
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/001.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -63,4 +63,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/002.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/003.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/004.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -56,4 +56,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/007.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/008.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -55,4 +55,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/013.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/014.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -55,4 +55,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/019.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/020.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -55,4 +55,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/025.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/026.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -55,4 +55,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/031.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/032.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -49,4 +49,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/033.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -52,4 +52,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/034.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -49,4 +49,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/037.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/038.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -53,4 +53,3 @@ bundle agent check
!ok::
"$(this.promise_filename) FAIL";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/040.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/041.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { init, test("banana"), check };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/042.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { init, test("banana"), check };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/044.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/045.x.cf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#####################################################
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
3 changes: 1 addition & 2 deletions tests/acceptance/00_basics/01_compiler/100.cf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down Expand Up @@ -47,4 +47,3 @@ bundle agent check
DEBUG::
"$(test.subout)";
}

2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/101.cf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/00_basics/01_compiler/102.x.cf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
body common control
{
inputs => { "../../default.cf.sub" };
inputs => { "../../default.sub.cf" };
bundlesequence => { default("$(this.promise_filename)") };
version => "1.0";
}
Expand Down
Loading
Loading