From 9933e3fbf86f79b303fbd9169c252ce19ba5f241 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 21:43:36 +0200 Subject: [PATCH 1/8] Renamed plucked.cf.sub to plucked.sub.cf This is a CFEngine policy file and should have a .cf file extension. These definitions are necessary for cfengine lint to find when it's looking for all the bodies and bundles defined in all .cf policy files. Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit be48690e2734eb0e47c6ed5770f28af7ab40ac00) --- tests/acceptance/Makefile.am | 3 ++- tests/acceptance/README.org | 4 ++-- tests/acceptance/lib/files/edit_line_converge.cf | 2 +- tests/acceptance/lib/files/edit_line_converge_prepend.cf | 2 +- tests/acceptance/lib/files/replace_uncommented_substrings.cf | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/acceptance/Makefile.am b/tests/acceptance/Makefile.am index 9e6410d9b2..1606bc3831 100644 --- a/tests/acceptance/Makefile.am +++ b/tests/acceptance/Makefile.am @@ -2,6 +2,7 @@ ENV_FILE=testall.env copy: cp $(core_dir)/tests/acceptance/*.cf.sub . + cp $(core_dir)/tests/acceptance/*.sub.cf . env: echo export CORE=\"$(core_dir)\" > $(ENV_FILE) @@ -22,7 +23,7 @@ check-local: create-env CLEANFILES = testall.env summary.log test.log test.xml Makefile.testall #These are created by running the submakefile -CLEANFILES += dcs.cf.sub default.cf.sub plucked.cf.sub +CLEANFILES += dcs.cf.sub default.cf.sub plucked.sub.cf EXTRA_DIST = README.md diff --git a/tests/acceptance/README.org b/tests/acceptance/README.org index 05fdda230d..6d15ad35ca 100644 --- a/tests/acceptance/README.org +++ b/tests/acceptance/README.org @@ -1,10 +1,10 @@ * Writing tests against the stdlib The test framework for masterfiles piggy backs on the test framework from core. -It's important to note =plucked.cf.sub= comes from the core repository and that +It's important to note =plucked.sub.cf= comes from the core repository and that it includes bodies and bundles from the stdlib which are useful in writing tests in core. This presents a problem for writing tests in the masterfiles framework -because =plucked.cf.sub= is included and simply including the stdlib could +because =plucked.sub.cf= is included and simply including the stdlib could result in duplicate definition of bundle errors. To work around this complication you can create a subtest that includes the diff --git a/tests/acceptance/lib/files/edit_line_converge.cf b/tests/acceptance/lib/files/edit_line_converge.cf index 37ed838878..27078bd283 100644 --- a/tests/acceptance/lib/files/edit_line_converge.cf +++ b/tests/acceptance/lib/files/edit_line_converge.cf @@ -11,7 +11,7 @@ bundle common classes classes: "testing_masterfiles_policy_framework" scope => "namespace", - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.cf.sub from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent init { diff --git a/tests/acceptance/lib/files/edit_line_converge_prepend.cf b/tests/acceptance/lib/files/edit_line_converge_prepend.cf index f34a3b8ca1..72bbcf5cc4 100644 --- a/tests/acceptance/lib/files/edit_line_converge_prepend.cf +++ b/tests/acceptance/lib/files/edit_line_converge_prepend.cf @@ -12,7 +12,7 @@ bundle common classes "testing_masterfiles_policy_framework" scope => "namespace", - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.cf.sub from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent init diff --git a/tests/acceptance/lib/files/replace_uncommented_substrings.cf b/tests/acceptance/lib/files/replace_uncommented_substrings.cf index 4ca8ae44cc..ad3e501058 100644 --- a/tests/acceptance/lib/files/replace_uncommented_substrings.cf +++ b/tests/acceptance/lib/files/replace_uncommented_substrings.cf @@ -12,7 +12,7 @@ bundle common classes classes: "testing_masterfiles_policy_framework" - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.cf.sub from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent test From b16abe37d3683e9a9d06d0d17afcf337594902fd Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 16 Apr 2026 01:57:38 +0200 Subject: [PATCH 2/8] Reformatted some initial files with cfengine format Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit e415520fead139bdc84692c24040355443b997a0) --- cfe_internal/CFE_cfengine.cf | 26 +++---- inventory/aix.cf | 55 ++++++--------- inventory/debian.cf | 132 ++++++++++++++++++++++------------- inventory/suse.cf | 6 +- lib/users.cf | 9 ++- 5 files changed, 126 insertions(+), 102 deletions(-) diff --git a/cfe_internal/CFE_cfengine.cf b/cfe_internal/CFE_cfengine.cf index 080f2288ae..ca2f0b2a28 100644 --- a/cfe_internal/CFE_cfengine.cf +++ b/cfe_internal/CFE_cfengine.cf @@ -18,22 +18,21 @@ bundle common cfe_internal_management_file_control # @brief Define policy input dependancies { vars: - - "inputs" slist => { }; + "inputs" slist => {}; cfengine_recommendations_enabled:: "input[cfengine_recommendations]" string => "$(this.promise_dirname)/recommendations.cf"; any:: - "inputs" slist => getvalues( input ); + "inputs" slist => getvalues(input); } body file control # @brief Include policy input dependancies { - cfengine_recommendations_enabled:: - inputs => { @(cfe_internal_management_file_control.inputs) }; + cfengine_recommendations_enabled:: + inputs => { @(cfe_internal_management_file_control.inputs) }; } bundle agent cfe_internal_management @@ -59,20 +58,15 @@ bundle agent cfe_internal_management "bundles" slist => getindices(policy); "recommendation_bundles" - slist => sort( bundlesmatching( ".*", "cfengine_recommends" ), lex); + slist => sort(bundlesmatching(".*", "cfengine_recommends"), lex); methods: + # CFEngine internals + "CFEngine_Internals" usebundle => "$(bundles)"; - # - # CFEngine internals - # - - "CFEngine_Internals" - usebundle => "$(bundles)"; - - "CFEngine Recommendations" - usebundle => $(recommendation_bundles), - if => isvariable( recommendation_bundles ); + "CFEngine Recommendations" + usebundle => $(recommendation_bundles), + if => isvariable(recommendation_bundles); reports: DEBUG|DEBUG_cfe_internal_management:: diff --git a/inventory/aix.cf b/inventory/aix.cf index 30353dc4d4..6076f3df4c 100644 --- a/inventory/aix.cf +++ b/inventory/aix.cf @@ -4,8 +4,7 @@ bundle agent inventory_aix # This agent bundle is for AIX inventory work. { methods: - "oslevel" - usebundle => inventory_aix_oslevel; + "oslevel" usebundle => inventory_aix_oslevel; } bundle agent inventory_aix_oslevel @@ -14,19 +13,17 @@ bundle agent inventory_aix_oslevel # for up to 1 day before re-discovering. { vars: - "oslevel" - string => ifelse( isvariable( "paths.oslevel" ), $(paths.oslevel), - "/usr/bin/oslevel" ); + string => ifelse( + isvariable("paths.oslevel"), $(paths.oslevel), "/usr/bin/oslevel" + ); commands: - aix:: - "$(oslevel)" handle => "cache_aix_oslevel_s", args => "-s > $(sys.statedir)/aix-oslevel-s", - if => not( fileexists( "$(sys.statedir)/aix-oslevel-s" ) ), + if => not(fileexists("$(sys.statedir)/aix-oslevel-s")), contain => in_shell, comment => "We cache the highest service pack reached to avoid unnecessary command executions."; @@ -34,45 +31,39 @@ bundle agent inventory_aix_oslevel "$(oslevel)" handle => "cache_aix_oslevel_r", args => "-r > $(sys.statedir)/aix-oslevel-r", - if => not( fileexists( "$(sys.statedir)/aix-oslevel-r" ) ), + if => not(fileexists("$(sys.statedir)/aix-oslevel-r")), contain => in_shell, comment => "We cache the highest technology level reached to avoid unnecessary command executions."; files: - aix:: - "$(sys.statedir)/aix-oslevel-r" handle => "cache_expire_aix_oslevel_r", delete => tidy, - file_select => days_old( 1 ), + file_select => days_old(1), comment => "We regularly clear the cache to avoid stale data"; "$(sys.statedir)/aix-oslevel-s" handle => "cache_expire_aix_oslevel_s", delete => tidy, - file_select => days_old( 1 ), + file_select => days_old(1), comment => "We regularly clear the cache to avoid stale data"; - vars: - + vars: aix:: - - "oslevel_s" - string => readfile("$(sys.statedir)/aix-oslevel-s", 1K ), - if => fileexists("$(sys.statedir)/aix-oslevel-s"), - meta => { "inventory", "attribute_name=Highest Service Pack" }; - - "oslevel_r" - string => readfile("$(sys.statedir)/aix-oslevel-r", 1K), - if => fileexists("$(sys.statedir)/aix-oslevel-r"), - meta => { "inventory", "attribute_name=Highest Technology Level" }; - - reports: - - DEBUG:: - - "Highest Service Pack: $(oslevel_s)"; - "Highest Technology Level: $(oslevel_r)"; + "oslevel_s" + string => readfile("$(sys.statedir)/aix-oslevel-s", 1K), + if => fileexists("$(sys.statedir)/aix-oslevel-s"), + meta => { "inventory", "attribute_name=Highest Service Pack" }; + + "oslevel_r" + string => readfile("$(sys.statedir)/aix-oslevel-r", 1K), + if => fileexists("$(sys.statedir)/aix-oslevel-r"), + meta => { "inventory", "attribute_name=Highest Technology Level" }; + + reports: + DEBUG:: + "Highest Service Pack: $(oslevel_s)"; + "Highest Technology Level: $(oslevel_r)"; } diff --git a/inventory/debian.cf b/inventory/debian.cf index a260dad332..a072f711f7 100644 --- a/inventory/debian.cf +++ b/inventory/debian.cf @@ -5,58 +5,90 @@ bundle common inventory_debian { vars: has_lsb_release:: - "lsb_release_info" string => readfile("/etc/lsb-release","256"), - comment => "Read more OS info" ; + "lsb_release_info" + string => readfile("/etc/lsb-release", "256"), + comment => "Read more OS info"; has_etc_linuxmint_info:: - "linuxmint_info" string => readfile("/etc/linuxmint/info","1024"), - comment => "Read Linux Mint specific info" ; + "linuxmint_info" + string => readfile("/etc/linuxmint/info", "1024"), + comment => "Read Linux Mint specific info"; "lm_info_count" - int => parsestringarray("mint_info", # array to populate - "$(linuxmint_info)", # data to parse - "\s*#[^\n]*", # comments - "=", # split - 100, # maxentries - 2048) ; # maxbytes - - "mint_release" string => "$(mint_info[RELEASE][1])" ; - "mint_codename" string => "$(mint_info[CODENAME][1])" ; + int => parsestringarray( + "mint_info", + # array to populate + "$(linuxmint_info)", + # data to parse + "\s*#[^\n]*", + # comments + "=", + # split + 100, + # maxentries + 2048 + ); + + # maxbytes + "mint_release" string => "$(mint_info[RELEASE][1])"; + "mint_codename" string => "$(mint_info[CODENAME][1])"; classes: any:: "debian_derived_evaluated" - scope => "bundle", - or => { isvariable("sys.os_release"), "has_lsb_release", "has_etc_linuxmint_info" } ; + scope => "bundle", + or => { + isvariable("sys.os_release"), + "has_lsb_release", + "has_etc_linuxmint_info", + }; "linuxmint" - expression => "has_etc_linuxmint_info", - comment => "this is a Linux Mint system, of some sort", - meta => { "inventory", "attribute_name=none" } ; + expression => "has_etc_linuxmint_info", + comment => "this is a Linux Mint system, of some sort", + meta => { "inventory", "attribute_name=none" }; has_lsb_release:: "linuxmint" - expression => regcmp("(?ms).*^DISTRIB_ID=LinuxMint$.*", "$(lsb_release_info)"), - comment => "this is a Linux Mint system, of some sort", - meta => { "inventory", "attribute_name=none" } ; + expression => regcmp( + "(?ms).*^DISTRIB_ID=LinuxMint$.*", "$(lsb_release_info)" + ), + comment => "this is a Linux Mint system, of some sort", + meta => { "inventory", "attribute_name=none" }; linuxmint:: "lmde" - expression => regcmp('.*LMDE.*', "$(sys.os_release[NAME])"), - comment => "this is a Linux Mint Debian Edition", - meta => { "inventory", "attribute_name=none", "derived-from=sys.os_release[NAME]" } ; + expression => regcmp('.*LMDE.*', "$(sys.os_release[NAME])"), + comment => "this is a Linux Mint Debian Edition", + meta => { + "inventory", + "attribute_name=none", + "derived-from=sys.os_release[NAME]", + }; linuxmint.has_lsb_release:: "lmde" - expression => regcmp('(?ms).*^DISTRIB_DESCRIPTION="LMDE.*', "$(lsb_release_info)"), - comment => "this is a Linux Mint Debian Edition", - meta => { "inventory", "attribute_name=none", "derived-from=inventory_debian.lsb_release_info" } ; + expression => regcmp( + '(?ms).*^DISTRIB_DESCRIPTION="LMDE.*', "$(lsb_release_info)" + ), + comment => "this is a Linux Mint Debian Edition", + meta => { + "inventory", + "attribute_name=none", + "derived-from=inventory_debian.lsb_release_info", + }; has_etc_linuxmint_info:: "lmde" - expression => regcmp('(?ms).*^DESCRIPTION="LMDE.*',"$(linuxmint_info)"), - comment => "this is a Linux Mint Debian Edition", - meta => { "inventory", "attribute_name=none", "derived-from=inventory_debian.linuxmint_info" } ; + expression => regcmp( + '(?ms).*^DESCRIPTION="LMDE.*', "$(linuxmint_info)" + ), + comment => "this is a Linux Mint Debian Edition", + meta => { + "inventory", + "attribute_name=none", + "derived-from=inventory_debian.linuxmint_info", + }; debian_derived_evaluated.has_etc_linuxmint_info.!lmde:: # These need to be evaluated only after debian_derived_evaluated is defined @@ -64,29 +96,35 @@ bundle common inventory_debian # Failing to do that will create meaningless classes # On non-LMDE Mint systems, this will create classes like, e.g.: # linuxmint_14, nadia, linuxmint_nadia - "linuxmint_$(mint_release)" expression => "any", - meta => { "inventory", "attribute_name=none" } ; + "linuxmint_$(mint_release)" + expression => "any", + meta => { "inventory", "attribute_name=none" }; - "$(mint_codename)" expression => "any", - meta => { "inventory", "attribute_name=none" } ; + "$(mint_codename)" + expression => "any", + meta => { "inventory", "attribute_name=none" }; - "linuxmint_$(mint_codename)" expression => "any", - meta => { "inventory", "attribute_name=none" } ; + "linuxmint_$(mint_codename)" + expression => "any", + meta => { "inventory", "attribute_name=none" }; debian_derived_evaluated:: - "debian_pure" expression => "debian.!(ubuntu|linuxmint)", - comment => "pure Debian", - meta => { "inventory", "attribute_name=none" }; + "debian_pure" + expression => "debian.!(ubuntu|linuxmint)", + comment => "pure Debian", + meta => { "inventory", "attribute_name=none" }; - "debian_derived" expression => "debian.!debian_pure", - comment => "derived from Debian", - meta => { "inventory", "attribute_name=none" }; + "debian_derived" + expression => "debian.!debian_pure", + comment => "derived from Debian", + meta => { "inventory", "attribute_name=none" }; any:: - "has_lsb_release" expression => fileexists("/etc/lsb-release"), - comment => "Check if we can get more info from /etc/lsb-release"; - - "has_etc_linuxmint_info" expression => fileexists("/etc/linuxmint/info"), - comment => "If this is a Linux Mint system, this *could* be available"; + "has_lsb_release" + expression => fileexists("/etc/lsb-release"), + comment => "Check if we can get more info from /etc/lsb-release"; + "has_etc_linuxmint_info" + expression => fileexists("/etc/linuxmint/info"), + comment => "If this is a Linux Mint system, this *could* be available"; } diff --git a/inventory/suse.cf b/inventory/suse.cf index 646279c288..c325c47666 100644 --- a/inventory/suse.cf +++ b/inventory/suse.cf @@ -4,11 +4,13 @@ bundle common inventory_suse # This common bundle is for SUSE Linux inventory work. { classes: - "suse_pure" expression => "(sles|sled).!opensuse", + "suse_pure" + expression => "(sles|sled).!opensuse", comment => "pure SUSE", meta => { "inventory", "attribute_name=none" }; - "suse_derived" expression => "opensuse.!suse_pure", + "suse_derived" + expression => "opensuse.!suse_pure", comment => "derived from SUSE", meta => { "inventory", "attribute_name=none" }; } diff --git a/lib/users.cf b/lib/users.cf index be44f92694..6709081aaf 100644 --- a/lib/users.cf +++ b/lib/users.cf @@ -1,5 +1,4 @@ # Users bodies - body password plaintext_password(text) # @brief Sets the plaintext password for the user to `text` # @param text the plain text version of the password @@ -8,8 +7,8 @@ body password plaintext_password(text) # # **See also:** `hashed_password()` { - format => "plaintext"; - data => $(text); + format => "plaintext"; + data => $(text); } body password hashed_password(hash) @@ -20,6 +19,6 @@ body password hashed_password(hash) # # **See also:** `plaintext_password()` { - format => "hash"; - data => $(hash); + format => "hash"; + data => $(hash); } From 713a651233ff9809037e1d1841690f027bb8bd8d Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Fri, 17 Apr 2026 13:52:15 +0200 Subject: [PATCH 3/8] inventory/debian.cf: Manually adjusted 1 comment location Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit e5fdacb44c0ae9c6259a481698682886f08def3b) --- inventory/debian.cf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/debian.cf b/inventory/debian.cf index a072f711f7..55861e16c9 100644 --- a/inventory/debian.cf +++ b/inventory/debian.cf @@ -27,9 +27,9 @@ bundle common inventory_debian 100, # maxentries 2048 + # maxbytes ); - # maxbytes "mint_release" string => "$(mint_info[RELEASE][1])"; "mint_codename" string => "$(mint_info[CODENAME][1])"; From 7bef849bcc2bee5ab36cae1d2b022c6c8f7d5432 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Wed, 22 Apr 2026 00:17:24 +0200 Subject: [PATCH 4/8] cfengine format tests/acceptance/promises/ Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit c6e3e662c5967d2352f456c7d612aaf5ab459b60) --- tests/acceptance/promises/autorun-D.cf | 36 ++++++------ tests/acceptance/promises/autorun-def_json.cf | 53 +++++++++-------- tests/acceptance/promises/autorun.cf | 57 +++++++++---------- tests/acceptance/promises/promises.cf | 22 +++---- 4 files changed, 79 insertions(+), 89 deletions(-) diff --git a/tests/acceptance/promises/autorun-D.cf b/tests/acceptance/promises/autorun-D.cf index 6d46727f68..c207c3d9d9 100644 --- a/tests/acceptance/promises/autorun-D.cf +++ b/tests/acceptance/promises/autorun-D.cf @@ -3,35 +3,35 @@ # Test autorun # ####################################################### - body common control { - inputs => { '../default.cf.sub' }; - bundlesequence => { default("$(this.promise_filename)") }; - version => "1.0"; + inputs => { '../default.cf.sub' }; + bundlesequence => { default("$(this.promise_filename)") }; + version => "1.0"; } bundle agent init { commands: - "$(G.make) install DESTDIR=$(G.testdir)" - contain => in_dir_shell("$(this.promise_dirname)/../../.."); + "$(G.make) install DESTDIR=$(G.testdir)" + contain => in_dir_shell("$(this.promise_dirname)/../../.."); + vars: - # If masterfiles are installed with --prefix=/other/prefix then we - # need to figure out where did "make install DESTDIR=..." has put - # the files. - "promises_cf_slist" slist => - findfiles("$(G.testdir)/**/promises.cf"); - "promises_cf_path" string => nth(promises_cf_slist, 0); + # If masterfiles are installed with --prefix=/other/prefix then we + # need to figure out where did "make install DESTDIR=..." has put + # the files. + "promises_cf_slist" slist => findfiles("$(G.testdir)/**/promises.cf"); + "promises_cf_path" string => nth(promises_cf_slist, 0); } - ####################################################### - bundle agent check { methods: - "" usebundle => dcs_passif_output(".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", - "", - "$(sys.cf_agent) -Dservices_autorun -v -f $(init.promises_cf_path) | $(G.grep) Hello", - $(this.promise_filename)); + "" + usebundle => dcs_passif_output( + ".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", + "", + "$(sys.cf_agent) -Dservices_autorun -v -f $(init.promises_cf_path) | $(G.grep) Hello", + $(this.promise_filename) + ); } diff --git a/tests/acceptance/promises/autorun-def_json.cf b/tests/acceptance/promises/autorun-def_json.cf index d9beaf3480..90afc216cf 100644 --- a/tests/acceptance/promises/autorun-def_json.cf +++ b/tests/acceptance/promises/autorun-def_json.cf @@ -3,56 +3,55 @@ # Test autorun # ####################################################### - body common control { - inputs => { '../default.cf.sub' }; - bundlesequence => { default("$(this.promise_filename)") }; - version => "1.0"; + inputs => { '../default.cf.sub' }; + bundlesequence => { default("$(this.promise_filename)") }; + version => "1.0"; } bundle agent init { commands: - "$(G.make) install DESTDIR=$(G.testdir)" - contain => in_dir_shell("$(this.promise_dirname)/../../.."); - vars: - # If masterfiles are installed with --prefix=/other/prefix then we - # need to figure out where did "make install DESTDIR=..." has put - # the files. - "promises_cf_slist" slist => - findfiles("$(G.testdir)/**/promises.cf"); - "promises_cf_path" string => nth(promises_cf_slist, 0); + "$(G.make) install DESTDIR=$(G.testdir)" + contain => in_dir_shell("$(this.promise_dirname)/../../.."); - "masterfiles_path" string => dirname("$(promises_cf_path)"); - "def_json_path" string => concat("$(masterfiles_path)", "/def.json"); + vars: + # If masterfiles are installed with --prefix=/other/prefix then we + # need to figure out where did "make install DESTDIR=..." has put + # the files. + "promises_cf_slist" slist => findfiles("$(G.testdir)/**/promises.cf"); + "promises_cf_path" string => nth(promises_cf_slist, 0); + "masterfiles_path" string => dirname("$(promises_cf_path)"); + "def_json_path" string => concat("$(masterfiles_path)", "/def.json"); } bundle agent test { meta: - "description" string => "Test that def.json can enable autorun as expected."; - + "description" + string => "Test that def.json can enable autorun as expected."; # We need to lay down the def.json that will enable autorun. files: - "$(init.def_json_path)" - create => "true", - edit_line => enable_autorun; + "$(init.def_json_path)" + create => "true", + edit_line => enable_autorun; } bundle edit_line enable_autorun { insert_lines: - '{ "classes": { "services_autorun": ["any"] } }'; + '{ "classes": { "services_autorun": ["any"] } }'; } - ####################################################### - bundle agent check { methods: - "" usebundle => dcs_passif_output(".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", - "", - "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello", - $(this.promise_filename)); + "" + usebundle => dcs_passif_output( + ".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", + "", + "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello", + $(this.promise_filename) + ); } diff --git a/tests/acceptance/promises/autorun.cf b/tests/acceptance/promises/autorun.cf index d5195a4392..4c05a9e619 100644 --- a/tests/acceptance/promises/autorun.cf +++ b/tests/acceptance/promises/autorun.cf @@ -3,38 +3,34 @@ # Test autorun # ####################################################### - body common control { - inputs => { '../default.cf.sub' }; - bundlesequence => { default("$(this.promise_filename)") }; - version => "1.0"; + inputs => { '../default.cf.sub' }; + bundlesequence => { default("$(this.promise_filename)") }; + version => "1.0"; } bundle agent init { commands: - "$(G.make) install DESTDIR=$(G.testdir)" - contain => in_dir_shell("$(this.promise_dirname)/../../.."); - vars: - # If masterfiles are installed with --prefix=/other/prefix then we - # need to figure out where did "make install DESTDIR=..." has put - # the files. - "promises_cf_slist" slist => - findfiles("$(G.testdir)/**/promises.cf"); - "promises_cf_path" string => nth(promises_cf_slist, 0); + "$(G.make) install DESTDIR=$(G.testdir)" + contain => in_dir_shell("$(this.promise_dirname)/../../.."); - "masterfiles_path" string => dirname("$(promises_cf_path)"); - "def_cf_path" string => concat("$(masterfiles_path)", "/controls/def.cf"); + vars: + # If masterfiles are installed with --prefix=/other/prefix then we + # need to figure out where did "make install DESTDIR=..." has put + # the files. + "promises_cf_slist" slist => findfiles("$(G.testdir)/**/promises.cf"); + "promises_cf_path" string => nth(promises_cf_slist, 0); + "masterfiles_path" string => dirname("$(promises_cf_path)"); + "def_cf_path" string => concat("$(masterfiles_path)", "/controls/def.cf"); } bundle agent test { meta: - - - "description" - string => "Test that enabling autorun from policy is not sufficient for activation. + "description" + string => "Test that enabling autorun from policy is not sufficient for activation. In order to prevent the parsing of files unnecessarily we guard that with the definition of the services_autorun class. If that class is defined from @@ -44,27 +40,28 @@ behavior to change so that defining from policy worked as desired. This test is intended to track that specific case and if ever fixed, simply update this test to allow it to pass."; - "test_soft_fail" - string => "any", - meta => { "redmine7572", "jiraCFE2135"}; + "test_soft_fail" + string => "any", + meta => { "redmine7572", "jiraCFE2135" }; files: - "$(init.def_cf_path)" edit_line => enable_autorun; + "$(init.def_cf_path)" edit_line => enable_autorun; } bundle edit_line enable_autorun { insert_lines: - 'bundle common __autorun_enable { classes: "services_autorun" expression => "any"; }'; + 'bundle common __autorun_enable { classes: "services_autorun" expression => "any"; }'; } - ####################################################### - bundle agent check { methods: - "" usebundle => dcs_passif_output(".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", - "", - "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello", - $(this.promise_filename)); + "" + usebundle => dcs_passif_output( + ".*R: hello_world_autorun: Hello, this is an automatically loaded bundle.*", + "", + "$(sys.cf_agent) -v -f $(init.promises_cf_path) | $(G.grep) Hello", + $(this.promise_filename) + ); } diff --git a/tests/acceptance/promises/promises.cf b/tests/acceptance/promises/promises.cf index ed0bf58cdf..60b79aca09 100644 --- a/tests/acceptance/promises/promises.cf +++ b/tests/acceptance/promises/promises.cf @@ -3,44 +3,38 @@ # Test promises.cf # ####################################################### - body common control { - inputs => { '../default.cf.sub' }; - bundlesequence => { default("$(this.promise_filename)") }; - version => "1.0"; + inputs => { '../default.cf.sub' }; + bundlesequence => { default("$(this.promise_filename)") }; + version => "1.0"; } - ####################################################### - bundle agent init { } - ####################################################### - bundle agent test { vars: - "rundir" string => dirname($(this.promise_filename)); + "rundir" string => dirname($(this.promise_filename)); commands: - "$(sys.cf_promises) -c --eval-functions -f $(this.promise_dirname)/../../../promises.cf" - classes => if_ok("agent_worked_all_right"); + "$(sys.cf_promises) -c --eval-functions -f $(this.promise_dirname)/../../../promises.cf" + classes => if_ok("agent_worked_all_right"); } - ####################################################### - bundle agent check { classes: - "ok" and => { "agent_worked_all_right" }; + "ok" and => { "agent_worked_all_right" }; reports: DEBUG:: ok:: "$(this.promise_filename) Pass"; + !ok:: "$(this.promise_filename) FAIL"; } From f9701e206bd8945077c79b40881881e8938c8825 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Wed, 22 Apr 2026 00:18:12 +0200 Subject: [PATCH 5/8] cfengine format services/ Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit 0cf6471c86b11daa8d0d9696dad331ddc0fde10f) --- services/autorun/hello.cf | 2 +- services/init.cf | 1 - services/main.cf | 4 +--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/services/autorun/hello.cf b/services/autorun/hello.cf index 051de66311..8765bba644 100644 --- a/services/autorun/hello.cf +++ b/services/autorun/hello.cf @@ -1,7 +1,7 @@ bundle agent hello_world_autorun { meta: - "tags" slist => { "autorun" }; + "tags" slist => { "autorun" }; reports: verbose_mode:: diff --git a/services/init.cf b/services/init.cf index 2e14f9c2f2..05039e4795 100644 --- a/services/init.cf +++ b/services/init.cf @@ -8,7 +8,6 @@ # This is loaded very early, only use hard classes or classes from def.json here. # ############################################################################### - # For example: # promise agent git # { diff --git a/services/main.cf b/services/main.cf index c36948c235..ef169336e2 100644 --- a/services/main.cf +++ b/services/main.cf @@ -4,11 +4,9 @@ # - User/Site policy entry # ############################################################################### - bundle agent mpf_main # User Defined Service Catalogue { methods: - # Activate your custom policies here - + # Activate your custom policies here } From cecce5c0f48a842e94ec8fc2ab980dc8af5919f6 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Thu, 30 Apr 2026 22:23:01 +0200 Subject: [PATCH 6/8] Renamed default.cf.sub and dcs.cf.sub to .sub.cf Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit 95246d0034a0cf4b94946529e31694b9073a862e) --- .../00_basics/def.json/control_common_bundlesequence_end.cf | 2 +- tests/acceptance/00_basics/def.json/inputs.cf | 2 +- tests/acceptance/09_services/unsafe/running_repaired.cf | 2 +- .../01_init/unsafe/timed/001-prepare-repositories.cf | 2 +- .../17_packages/10_new/unsafe/the_great_package_test.cf | 2 +- .../10_new/unsafe/the_great_package_test_generator.py | 2 +- .../17_packages/11_old/unsafe/11_packagesmatching.cf | 2 +- .../17_packages/11_old/unsafe/12_packagesmatching.cf | 2 +- .../17_packages/11_old/unsafe/named_multi_pkg_absent.cf | 3 +-- .../17_packages/11_old/unsafe/named_multi_pkg_present.cf | 2 +- .../17_packages/11_old/unsafe/named_multi_pkg_upgrade.cf | 2 +- .../17_packages/11_old/unsafe/named_pkg_absent.cf | 3 +-- .../17_packages/11_old/unsafe/named_pkg_file_present.cf | 4 +--- .../17_packages/11_old/unsafe/named_pkg_file_upgrade.cf | 4 +--- .../17_packages/11_old/unsafe/named_pkg_present.cf | 2 +- .../17_packages/11_old/unsafe/named_pkg_upgrade.cf | 2 +- .../11_old/unsafe/named_versioned_pkg_present.cf | 4 +--- .../11_old/unsafe/named_versioned_pkg_upgrade.cf | 2 +- .../17_packages/11_old/unsafe/package-inventory.cf | 2 +- .../11_old/unsafe/staging/named_pkg_same_version_kept.cf | 2 +- .../11_old/unsafe/staging/named_versioned_pkg_absent.cf | 5 +---- .../unsafe/timed/inventory_packages_update_frequency.cf | 2 +- .../17_packages/12_new/timed/installed-list-cached.cf | 2 +- .../17_packages/12_new/timed/installed-list-cached.cf.sub | 2 +- .../17_packages/12_new/timed/local-updates-list-cached.cf | 2 +- .../12_new/timed/local-updates-list-cached.cf.sub | 2 +- .../acceptance/17_packages/12_new/timed/packagesmatching.cf | 3 +-- .../17_packages/12_new/timed/updates-list-cached.cf | 2 +- .../17_packages/12_new/timed/updates-list-cached.cf.sub | 2 +- tests/acceptance/17_packages/multiline_yum_check_update.cf | 4 ++-- .../30_custom_promise_types/05_cp_using_library.cf | 2 +- .../30_custom_promise_types/06_cp_with_classes.cf | 2 +- .../acceptance/30_custom_promise_types/07_python_library.cf | 2 +- tests/acceptance/30_custom_promise_types/08_slist_attrs.cf | 2 +- tests/acceptance/30_custom_promise_types/09_log_level.cf | 2 +- .../acceptance/30_custom_promise_types/09_log_level.cf.sub | 2 +- .../30_custom_promise_types/10_log_level_bad_module.cf | 2 +- .../30_custom_promise_types/10_log_level_bad_module.cf.sub | 2 +- tests/acceptance/30_custom_promise_types/11_handle.cf | 2 +- tests/acceptance/30_custom_promise_types/16_data_attrs.cf | 2 +- .../30_custom_promise_types/19_different_promise_types.cf | 2 +- tests/acceptance/30_custom_promise_types/20_depends_on.cf | 2 +- .../acceptance/30_custom_promise_types/21_with_attribute.cf | 2 +- tests/acceptance/30_custom_promise_types/22_bodies.cf | 2 +- .../30_custom_promise_types/22_single_evaluation.cf | 2 +- tests/acceptance/30_custom_promise_types/23_comment.cf | 2 +- tests/acceptance/30_custom_promise_types/24_expireafter.cf | 2 +- .../30_custom_promise_types/24_expireafter.cf.sub | 2 +- .../25_top_down_evaluation_custom_promise_types.cf | 2 +- tests/acceptance/Makefile.am | 3 +-- tests/acceptance/README.org | 6 +++--- tests/acceptance/lib/bundles/run_ifdefined.cf | 2 +- tests/acceptance/lib/common/always.cf | 2 +- tests/acceptance/lib/files/CFE-1710.cf | 2 +- tests/acceptance/lib/files/append_user_field.cf | 2 +- tests/acceptance/lib/files/edit_line_converge.cf | 4 ++-- tests/acceptance/lib/files/edit_line_converge_prepend.cf | 4 ++-- tests/acceptance/lib/files/insert_ini_section.cf | 2 +- tests/acceptance/lib/files/manage_variable_values_ini.cf | 2 +- .../lib/files/manage_variable_values_ini_metachar.cf | 2 +- .../acceptance/lib/files/replace_uncommented_substrings.cf | 4 ++-- tests/acceptance/lib/files/set_config_values.cf | 2 +- tests/acceptance/lib/files/set_line_based-ENT-5866.cf | 2 +- tests/acceptance/lib/files/set_line_based_config_values.cf | 2 +- .../acceptance/lib/files/set_line_based_variable_values.cf | 2 +- tests/acceptance/lib/files/set_variable_values.cf | 2 +- tests/acceptance/lib/files/set_variable_values_ini.cf | 2 +- .../lib/files/set_variable_values_ini_missing_section.cf | 2 +- tests/acceptance/lib/reports/cat.cf | 2 +- tests/acceptance/lib/reports/head.cf | 2 +- tests/acceptance/lib/reports/head_n.cf | 2 +- tests/acceptance/lib/reports/tail.cf | 2 +- tests/acceptance/lib/reports/tail_n.cf | 2 +- tests/acceptance/promises/autorun-D.cf | 2 +- tests/acceptance/promises/autorun-def_json.cf | 2 +- tests/acceptance/promises/autorun.cf | 2 +- tests/acceptance/promises/promises.cf | 2 +- 77 files changed, 83 insertions(+), 96 deletions(-) diff --git a/tests/acceptance/00_basics/def.json/control_common_bundlesequence_end.cf b/tests/acceptance/00_basics/def.json/control_common_bundlesequence_end.cf index 62ad6f5a8e..255febd1e1 100644 --- a/tests/acceptance/00_basics/def.json/control_common_bundlesequence_end.cf +++ b/tests/acceptance/00_basics/def.json/control_common_bundlesequence_end.cf @@ -3,7 +3,7 @@ body common control { - inputs => { "../../default.cf.sub" }; + inputs => { "../../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/00_basics/def.json/inputs.cf b/tests/acceptance/00_basics/def.json/inputs.cf index b3af8eeda6..eeb1353400 100644 --- a/tests/acceptance/00_basics/def.json/inputs.cf +++ b/tests/acceptance/00_basics/def.json/inputs.cf @@ -7,7 +7,7 @@ body common control { - inputs => { "../../default.cf.sub" }; + inputs => { "../../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/09_services/unsafe/running_repaired.cf b/tests/acceptance/09_services/unsafe/running_repaired.cf index a46c6de59d..580b9934d8 100644 --- a/tests/acceptance/09_services/unsafe/running_repaired.cf +++ b/tests/acceptance/09_services/unsafe/running_repaired.cf @@ -10,7 +10,7 @@ vars: body common control { - inputs => { "../../dcs.cf.sub", + inputs => { "../../dcs.sub.cf", "../../../../$(sys.local_libdir)/stdlib.cf", "service_common.cf.sub" }; diff --git a/tests/acceptance/17_packages/01_init/unsafe/timed/001-prepare-repositories.cf b/tests/acceptance/17_packages/01_init/unsafe/timed/001-prepare-repositories.cf index 7f0d3ab486..b153624327 100644 --- a/tests/acceptance/17_packages/01_init/unsafe/timed/001-prepare-repositories.cf +++ b/tests/acceptance/17_packages/01_init/unsafe/timed/001-prepare-repositories.cf @@ -9,7 +9,7 @@ body common control { - inputs => { "../../../../dcs.cf.sub", + inputs => { "../../../../dcs.sub.cf", "../../../../../../$(sys.local_libdir)/files.cf", "../../../../../../$(sys.local_libdir)/commands.cf", "../../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test.cf b/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test.cf index d89b35bfe2..f38ed9da1a 100644 --- a/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test.cf +++ b/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test.cf @@ -11,7 +11,7 @@ body common control { - inputs => { "../../../dcs.cf.sub", + inputs => { "../../../dcs.sub.cf", "../../../../../controls/def.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../../../../$(sys.local_libdir)/commands.cf", diff --git a/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test_generator.py b/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test_generator.py index cc144d8a49..962a8ca9e0 100755 --- a/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test_generator.py +++ b/tests/acceptance/17_packages/10_new/unsafe/the_great_package_test_generator.py @@ -97,7 +97,7 @@ def header(test_count): body common control { - inputs => { "../../../dcs.cf.sub", + inputs => { "../../../dcs.sub.cf", "../../../../../controls/def.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../../../../$(sys.local_libdir)/commands.cf", diff --git a/tests/acceptance/17_packages/11_old/unsafe/11_packagesmatching.cf b/tests/acceptance/17_packages/11_old/unsafe/11_packagesmatching.cf index b63b886ab4..cd61f56353 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/11_packagesmatching.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/11_packagesmatching.cf @@ -10,7 +10,7 @@ body common control { inputs => { "../../packages-info.cf.sub", - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf" }; diff --git a/tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf b/tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf index ef382f271b..0c7ea5d8d6 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/12_packagesmatching.cf @@ -18,7 +18,7 @@ body common control { inputs => { "../../packages-info.cf.sub", "../../meta_skip.cf.sub", - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../inventory/any.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_absent.cf b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_absent.cf index 78b291804c..f22de1de0c 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_absent.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_absent.cf @@ -11,7 +11,7 @@ bundle common test_meta body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", @@ -132,4 +132,3 @@ body classes succesfully_executed(class) kept_returncodes => { "0" }; promise_kept => { "$(class)" }; } - diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_present.cf b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_present.cf index 5c22b6dc5f..c3a5e911fb 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_present.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_present.cf @@ -11,7 +11,7 @@ bundle common test_meta body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_upgrade.cf b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_upgrade.cf index eac188b227..b69e88591c 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_upgrade.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_multi_pkg_upgrade.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_absent.cf b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_absent.cf index 419dab16ee..5ceb1b4245 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_absent.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_absent.cf @@ -11,7 +11,7 @@ bundle common test_meta body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", @@ -109,4 +109,3 @@ body classes succesfully_executed(class) kept_returncodes => { "0" }; promise_kept => { "$(class)" }; } - diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_present.cf b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_present.cf index 6234d2b31d..8b353daddb 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_present.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_present.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", @@ -96,5 +96,3 @@ bundle agent check !ok:: "$(this.promise_filename) FAIL"; } - - diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_upgrade.cf b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_upgrade.cf index e3a687dc3a..cf607ca7d6 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_upgrade.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_file_upgrade.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", @@ -92,5 +92,3 @@ bundle agent check !ok:: "$(this.promise_filename) FAIL"; } - - diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_present.cf b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_present.cf index 75c2961158..a3b01b34fe 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_present.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_present.cf @@ -11,7 +11,7 @@ bundle common test_meta body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_upgrade.cf b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_upgrade.cf index 249bb37cc6..3b007ee37a 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_pkg_upgrade.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_pkg_upgrade.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_present.cf b/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_present.cf index 0f21a7e040..7194fb0768 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_present.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_present.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", @@ -105,5 +105,3 @@ body classes succesfully_executed(class) kept_returncodes => { "0" }; promise_kept => { "$(class)" }; } - - diff --git a/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_upgrade.cf b/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_upgrade.cf index 755aa4cf90..0dad12463c 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_upgrade.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/named_versioned_pkg_upgrade.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../dcs.cf.sub", + "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../packages-info.cf.sub", diff --git a/tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf b/tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf index 08655fb47a..35350dd40e 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/package-inventory.cf @@ -8,7 +8,7 @@ bundle common test_meta body common control { - inputs => { "../../../dcs.cf.sub", + inputs => { "../../../dcs.sub.cf", "../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../$(sys.local_libdir)/packages.cf", "../../../../../inventory/any.cf", diff --git a/tests/acceptance/17_packages/11_old/unsafe/staging/named_pkg_same_version_kept.cf b/tests/acceptance/17_packages/11_old/unsafe/staging/named_pkg_same_version_kept.cf index a5074315d0..09e4c9c384 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/staging/named_pkg_same_version_kept.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/staging/named_pkg_same_version_kept.cf @@ -8,7 +8,7 @@ body common control { inputs => { - "../../../default.cf.sub", + "../../../default.sub.cf", "../../../../../lib/3.6/packages.cf", "../../packages-info.cf.sub", }; diff --git a/tests/acceptance/17_packages/11_old/unsafe/staging/named_versioned_pkg_absent.cf b/tests/acceptance/17_packages/11_old/unsafe/staging/named_versioned_pkg_absent.cf index 61625a17bf..235017826f 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/staging/named_versioned_pkg_absent.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/staging/named_versioned_pkg_absent.cf @@ -7,7 +7,7 @@ body common control { inputs => { - "../../../default.cf.sub", + "../../../default.sub.cf", "../../../../../lib/3.6/packages.cf", "../../packages-info.cf.sub", }; @@ -121,6 +121,3 @@ body classes succesfully_executed(class) kept_returncodes => { "0" }; promise_kept => { "$(class)" }; } - - - diff --git a/tests/acceptance/17_packages/11_old/unsafe/timed/inventory_packages_update_frequency.cf b/tests/acceptance/17_packages/11_old/unsafe/timed/inventory_packages_update_frequency.cf index f900104e4e..a7e05c1826 100644 --- a/tests/acceptance/17_packages/11_old/unsafe/timed/inventory_packages_update_frequency.cf +++ b/tests/acceptance/17_packages/11_old/unsafe/timed/inventory_packages_update_frequency.cf @@ -3,7 +3,7 @@ body common control { - inputs => { "../../../../dcs.cf.sub", + inputs => { "../../../../dcs.sub.cf", "../../../../../../inventory/any.cf", "../../../../../../$(sys.local_libdir)/stdlib.cf", "../../../../../../$(sys.local_libdir)/packages.cf" diff --git a/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf b/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf index 2c4b89e3e0..f9ace0daff 100644 --- a/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf +++ b/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf @@ -2,7 +2,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; } diff --git a/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf.sub b/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf.sub index 212e5bf97b..4776c35e4b 100644 --- a/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf.sub +++ b/tests/acceptance/17_packages/12_new/timed/installed-list-cached.cf.sub @@ -2,7 +2,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; package_module => "test_module"; diff --git a/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf b/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf index 0d21e3421e..d882d35815 100644 --- a/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf +++ b/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf @@ -3,7 +3,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; } diff --git a/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf.sub b/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf.sub index e680074f53..f1542993f9 100644 --- a/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf.sub +++ b/tests/acceptance/17_packages/12_new/timed/local-updates-list-cached.cf.sub @@ -3,7 +3,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; package_module => "test_module"; diff --git a/tests/acceptance/17_packages/12_new/timed/packagesmatching.cf b/tests/acceptance/17_packages/12_new/timed/packagesmatching.cf index b91889c450..3bb5762d52 100644 --- a/tests/acceptance/17_packages/12_new/timed/packagesmatching.cf +++ b/tests/acceptance/17_packages/12_new/timed/packagesmatching.cf @@ -2,7 +2,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; package_inventory => { test_module }; @@ -84,4 +84,3 @@ bundle agent check test_pass_3.!ok_pass3:: "$(this.promise_filename) FAIL"; } - diff --git a/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf b/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf index 91010dceae..ae34ee81bf 100644 --- a/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf +++ b/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf @@ -2,7 +2,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; } diff --git a/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf.sub b/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf.sub index ff86412af9..49fefc32f3 100644 --- a/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf.sub +++ b/tests/acceptance/17_packages/12_new/timed/updates-list-cached.cf.sub @@ -2,7 +2,7 @@ body common control { - inputs => { "../../../default.cf.sub" }; + inputs => { "../../../default.sub.cf" }; bundlesequence => { default($(this.promise_filename)) }; package_module => "test_module"; diff --git a/tests/acceptance/17_packages/multiline_yum_check_update.cf b/tests/acceptance/17_packages/multiline_yum_check_update.cf index f5cb0ac6cd..20c00022c5 100644 --- a/tests/acceptance/17_packages/multiline_yum_check_update.cf +++ b/tests/acceptance/17_packages/multiline_yum_check_update.cf @@ -5,13 +5,13 @@ body common control { cfengine_3_7:: inputs => { - "../dcs.cf.sub", + "../dcs.sub.cf", "../../../lib/stdlib.cf", "../../../lib/packages.cf", }; !cfengine_3_7:: - inputs => { "../dcs.cf.sub", + inputs => { "../dcs.sub.cf", "../../../$(sys.local_libdir)/stdlib.cf", "../../../$(sys.local_libdir)/packages.cf", }; diff --git a/tests/acceptance/30_custom_promise_types/05_cp_using_library.cf b/tests/acceptance/30_custom_promise_types/05_cp_using_library.cf index ab28397a8d..c10346cdb3 100644 --- a/tests/acceptance/30_custom_promise_types/05_cp_using_library.cf +++ b/tests/acceptance/30_custom_promise_types/05_cp_using_library.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/06_cp_with_classes.cf b/tests/acceptance/30_custom_promise_types/06_cp_with_classes.cf index 0b79d4fae9..61f03ee7f1 100644 --- a/tests/acceptance/30_custom_promise_types/06_cp_with_classes.cf +++ b/tests/acceptance/30_custom_promise_types/06_cp_with_classes.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/07_python_library.cf b/tests/acceptance/30_custom_promise_types/07_python_library.cf index b6c978d254..12e63a6747 100644 --- a/tests/acceptance/30_custom_promise_types/07_python_library.cf +++ b/tests/acceptance/30_custom_promise_types/07_python_library.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/08_slist_attrs.cf b/tests/acceptance/30_custom_promise_types/08_slist_attrs.cf index 7eb6fde06f..c86770676f 100644 --- a/tests/acceptance/30_custom_promise_types/08_slist_attrs.cf +++ b/tests/acceptance/30_custom_promise_types/08_slist_attrs.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/09_log_level.cf b/tests/acceptance/30_custom_promise_types/09_log_level.cf index 92e7f4bc08..bc0b9f9496 100644 --- a/tests/acceptance/30_custom_promise_types/09_log_level.cf +++ b/tests/acceptance/30_custom_promise_types/09_log_level.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/09_log_level.cf.sub b/tests/acceptance/30_custom_promise_types/09_log_level.cf.sub index 7e4a6e6515..d431415794 100644 --- a/tests/acceptance/30_custom_promise_types/09_log_level.cf.sub +++ b/tests/acceptance/30_custom_promise_types/09_log_level.cf.sub @@ -1,6 +1,6 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf b/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf index 92e7f4bc08..bc0b9f9496 100644 --- a/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf +++ b/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf.sub b/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf.sub index 8c6e560a70..47b7635a72 100644 --- a/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf.sub +++ b/tests/acceptance/30_custom_promise_types/10_log_level_bad_module.cf.sub @@ -1,6 +1,6 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/11_handle.cf b/tests/acceptance/30_custom_promise_types/11_handle.cf index 53ecad4d7d..81aba4f0df 100644 --- a/tests/acceptance/30_custom_promise_types/11_handle.cf +++ b/tests/acceptance/30_custom_promise_types/11_handle.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/16_data_attrs.cf b/tests/acceptance/30_custom_promise_types/16_data_attrs.cf index 4f47c83f0d..23e8fcb11b 100644 --- a/tests/acceptance/30_custom_promise_types/16_data_attrs.cf +++ b/tests/acceptance/30_custom_promise_types/16_data_attrs.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/19_different_promise_types.cf b/tests/acceptance/30_custom_promise_types/19_different_promise_types.cf index cd4ffe5cc4..b8b5873d73 100644 --- a/tests/acceptance/30_custom_promise_types/19_different_promise_types.cf +++ b/tests/acceptance/30_custom_promise_types/19_different_promise_types.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/20_depends_on.cf b/tests/acceptance/30_custom_promise_types/20_depends_on.cf index 8443e167d6..359a858f1f 100644 --- a/tests/acceptance/30_custom_promise_types/20_depends_on.cf +++ b/tests/acceptance/30_custom_promise_types/20_depends_on.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/21_with_attribute.cf b/tests/acceptance/30_custom_promise_types/21_with_attribute.cf index 40b1b3c7ae..0f8d165c0d 100644 --- a/tests/acceptance/30_custom_promise_types/21_with_attribute.cf +++ b/tests/acceptance/30_custom_promise_types/21_with_attribute.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/22_bodies.cf b/tests/acceptance/30_custom_promise_types/22_bodies.cf index 9aba71e11a..8b30c0fa38 100644 --- a/tests/acceptance/30_custom_promise_types/22_bodies.cf +++ b/tests/acceptance/30_custom_promise_types/22_bodies.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/22_single_evaluation.cf b/tests/acceptance/30_custom_promise_types/22_single_evaluation.cf index 7a0011ef4e..3fe12da6c7 100644 --- a/tests/acceptance/30_custom_promise_types/22_single_evaluation.cf +++ b/tests/acceptance/30_custom_promise_types/22_single_evaluation.cf @@ -5,7 +5,7 @@ ##################################################### body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/23_comment.cf b/tests/acceptance/30_custom_promise_types/23_comment.cf index 756e24b6ef..af570ad091 100755 --- a/tests/acceptance/30_custom_promise_types/23_comment.cf +++ b/tests/acceptance/30_custom_promise_types/23_comment.cf @@ -6,7 +6,7 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/24_expireafter.cf b/tests/acceptance/30_custom_promise_types/24_expireafter.cf index 1a2886845e..e1df835da4 100644 --- a/tests/acceptance/30_custom_promise_types/24_expireafter.cf +++ b/tests/acceptance/30_custom_promise_types/24_expireafter.cf @@ -6,7 +6,7 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/24_expireafter.cf.sub b/tests/acceptance/30_custom_promise_types/24_expireafter.cf.sub index e23bbbdbd2..5d7ee8b98e 100644 --- a/tests/acceptance/30_custom_promise_types/24_expireafter.cf.sub +++ b/tests/acceptance/30_custom_promise_types/24_expireafter.cf.sub @@ -6,7 +6,7 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { "test" }; version => "1.0"; } diff --git a/tests/acceptance/30_custom_promise_types/25_top_down_evaluation_custom_promise_types.cf b/tests/acceptance/30_custom_promise_types/25_top_down_evaluation_custom_promise_types.cf index 10aea0b755..5b0feb8968 100644 --- a/tests/acceptance/30_custom_promise_types/25_top_down_evaluation_custom_promise_types.cf +++ b/tests/acceptance/30_custom_promise_types/25_top_down_evaluation_custom_promise_types.cf @@ -1,6 +1,6 @@ body common control { - inputs => { "../default.cf.sub" }; + inputs => { "../default.sub.cf" }; bundlesequence => { "test", "cleanup" }; evaluation_order => "top_down"; } diff --git a/tests/acceptance/Makefile.am b/tests/acceptance/Makefile.am index 1606bc3831..577aaf6862 100644 --- a/tests/acceptance/Makefile.am +++ b/tests/acceptance/Makefile.am @@ -1,7 +1,6 @@ ENV_FILE=testall.env copy: - cp $(core_dir)/tests/acceptance/*.cf.sub . cp $(core_dir)/tests/acceptance/*.sub.cf . env: @@ -23,7 +22,7 @@ check-local: create-env CLEANFILES = testall.env summary.log test.log test.xml Makefile.testall #These are created by running the submakefile -CLEANFILES += dcs.cf.sub default.cf.sub plucked.sub.cf +CLEANFILES += dcs.sub.cf default.sub.cf plucked.sub.cf EXTRA_DIST = README.md diff --git a/tests/acceptance/README.org b/tests/acceptance/README.org index 6d15ad35ca..6168380e60 100644 --- a/tests/acceptance/README.org +++ b/tests/acceptance/README.org @@ -12,7 +12,7 @@ stdlib directly, but does not include the rest of the test framework. ** Example test -This is the main test. Note how it includes =default.cf.sub= and runs the +This is the main test. Note how it includes =default.sub.cf= and runs the typical test bundlesequence. The test passes based on the *OUTPUT* of the subtest which runs from a policy file with the same name suffixed with =.sub=. @@ -20,7 +20,7 @@ subtest which runs from a policy file with the same name suffixed with =.sub=. #+BEGIN_SRC cfengine3 body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } @@ -55,7 +55,7 @@ R: line 9"; #+END_SRC This is the subtest itself. Note how it *does not include the test framework* -(=default.cf.sub=) but instead includes the part of the standard library that it +(=default.sub.cf=) but instead includes the part of the standard library that it needs for the test. In this case the subtest outputs information that the main test inspects for pass or failure. The main test could also inspect data in other files. Consider writing a data file containing the =datastate()= or diff --git a/tests/acceptance/lib/bundles/run_ifdefined.cf b/tests/acceptance/lib/bundles/run_ifdefined.cf index 5a88a1c8cb..1fc343441f 100644 --- a/tests/acceptance/lib/bundles/run_ifdefined.cf +++ b/tests/acceptance/lib/bundles/run_ifdefined.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; } diff --git a/tests/acceptance/lib/common/always.cf b/tests/acceptance/lib/common/always.cf index 9dd67e958d..b2e7b35f70 100644 --- a/tests/acceptance/lib/common/always.cf +++ b/tests/acceptance/lib/common/always.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/CFE-1710.cf b/tests/acceptance/lib/files/CFE-1710.cf index 5b15e113b0..10af749f83 100644 --- a/tests/acceptance/lib/files/CFE-1710.cf +++ b/tests/acceptance/lib/files/CFE-1710.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/append_user_field.cf b/tests/acceptance/lib/files/append_user_field.cf index 334dc1d50a..ca0ca5117d 100644 --- a/tests/acceptance/lib/files/append_user_field.cf +++ b/tests/acceptance/lib/files/append_user_field.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/edit_line_converge.cf b/tests/acceptance/lib/files/edit_line_converge.cf index 27078bd283..3b4b3db75a 100644 --- a/tests/acceptance/lib/files/edit_line_converge.cf +++ b/tests/acceptance/lib/files/edit_line_converge.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } @@ -11,7 +11,7 @@ bundle common classes classes: "testing_masterfiles_policy_framework" scope => "namespace", - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.sub.cf includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent init { diff --git a/tests/acceptance/lib/files/edit_line_converge_prepend.cf b/tests/acceptance/lib/files/edit_line_converge_prepend.cf index 72bbcf5cc4..0eab824005 100644 --- a/tests/acceptance/lib/files/edit_line_converge_prepend.cf +++ b/tests/acceptance/lib/files/edit_line_converge_prepend.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } @@ -12,7 +12,7 @@ bundle common classes "testing_masterfiles_policy_framework" scope => "namespace", - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.sub.cf includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent init diff --git a/tests/acceptance/lib/files/insert_ini_section.cf b/tests/acceptance/lib/files/insert_ini_section.cf index 8917687bc9..b3b829253c 100644 --- a/tests/acceptance/lib/files/insert_ini_section.cf +++ b/tests/acceptance/lib/files/insert_ini_section.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/manage_variable_values_ini.cf b/tests/acceptance/lib/files/manage_variable_values_ini.cf index 15111f5e6a..c4b3b76ddd 100644 --- a/tests/acceptance/lib/files/manage_variable_values_ini.cf +++ b/tests/acceptance/lib/files/manage_variable_values_ini.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/manage_variable_values_ini_metachar.cf b/tests/acceptance/lib/files/manage_variable_values_ini_metachar.cf index 61de436e01..ea946ff371 100644 --- a/tests/acceptance/lib/files/manage_variable_values_ini_metachar.cf +++ b/tests/acceptance/lib/files/manage_variable_values_ini_metachar.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/replace_uncommented_substrings.cf b/tests/acceptance/lib/files/replace_uncommented_substrings.cf index ad3e501058..63fcc592c7 100644 --- a/tests/acceptance/lib/files/replace_uncommented_substrings.cf +++ b/tests/acceptance/lib/files/replace_uncommented_substrings.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub', + inputs => { '../../default.sub.cf', }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; @@ -12,7 +12,7 @@ bundle common classes classes: "testing_masterfiles_policy_framework" - comment => "This class is needed so that dcs.cf.sub includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; + comment => "This class is needed so that dcs.sub.cf includes the stdlib instead of using plucked.sub.cf from core which might get out of date and cause us to not test current code from the MPF."; } bundle agent test diff --git a/tests/acceptance/lib/files/set_config_values.cf b/tests/acceptance/lib/files/set_config_values.cf index a3a7d372c5..e4671d75a1 100644 --- a/tests/acceptance/lib/files/set_config_values.cf +++ b/tests/acceptance/lib/files/set_config_values.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_line_based-ENT-5866.cf b/tests/acceptance/lib/files/set_line_based-ENT-5866.cf index 565af9691c..3ee2b3cdcf 100644 --- a/tests/acceptance/lib/files/set_line_based-ENT-5866.cf +++ b/tests/acceptance/lib/files/set_line_based-ENT-5866.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_line_based_config_values.cf b/tests/acceptance/lib/files/set_line_based_config_values.cf index 2b4e4728a8..4ca2071b62 100644 --- a/tests/acceptance/lib/files/set_line_based_config_values.cf +++ b/tests/acceptance/lib/files/set_line_based_config_values.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_line_based_variable_values.cf b/tests/acceptance/lib/files/set_line_based_variable_values.cf index fa2db933cb..86f987e5a5 100644 --- a/tests/acceptance/lib/files/set_line_based_variable_values.cf +++ b/tests/acceptance/lib/files/set_line_based_variable_values.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_variable_values.cf b/tests/acceptance/lib/files/set_variable_values.cf index 757e0d2337..7047f7d622 100644 --- a/tests/acceptance/lib/files/set_variable_values.cf +++ b/tests/acceptance/lib/files/set_variable_values.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_variable_values_ini.cf b/tests/acceptance/lib/files/set_variable_values_ini.cf index 41707edf9b..e0e9e326bd 100644 --- a/tests/acceptance/lib/files/set_variable_values_ini.cf +++ b/tests/acceptance/lib/files/set_variable_values_ini.cf @@ -6,7 +6,7 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/files/set_variable_values_ini_missing_section.cf b/tests/acceptance/lib/files/set_variable_values_ini_missing_section.cf index 6671d8af72..a2585b9d0a 100644 --- a/tests/acceptance/lib/files/set_variable_values_ini_missing_section.cf +++ b/tests/acceptance/lib/files/set_variable_values_ini_missing_section.cf @@ -6,7 +6,7 @@ body common control { - inputs => { "../../default.cf.sub" }; + inputs => { "../../default.sub.cf" }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/reports/cat.cf b/tests/acceptance/lib/reports/cat.cf index 5baccb08d9..04a6830782 100644 --- a/tests/acceptance/lib/reports/cat.cf +++ b/tests/acceptance/lib/reports/cat.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/reports/head.cf b/tests/acceptance/lib/reports/head.cf index 3833106460..8b5f4592e5 100644 --- a/tests/acceptance/lib/reports/head.cf +++ b/tests/acceptance/lib/reports/head.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/reports/head_n.cf b/tests/acceptance/lib/reports/head_n.cf index fc016e1a0c..bd291bdd75 100644 --- a/tests/acceptance/lib/reports/head_n.cf +++ b/tests/acceptance/lib/reports/head_n.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/reports/tail.cf b/tests/acceptance/lib/reports/tail.cf index 1809808c34..6321541959 100644 --- a/tests/acceptance/lib/reports/tail.cf +++ b/tests/acceptance/lib/reports/tail.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/lib/reports/tail_n.cf b/tests/acceptance/lib/reports/tail_n.cf index 4c819716e8..186082e852 100644 --- a/tests/acceptance/lib/reports/tail_n.cf +++ b/tests/acceptance/lib/reports/tail_n.cf @@ -1,6 +1,6 @@ body common control { - inputs => { '../../default.cf.sub' }; + inputs => { '../../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/promises/autorun-D.cf b/tests/acceptance/promises/autorun-D.cf index c207c3d9d9..1e2a685d02 100644 --- a/tests/acceptance/promises/autorun-D.cf +++ b/tests/acceptance/promises/autorun-D.cf @@ -5,7 +5,7 @@ ####################################################### body common control { - inputs => { '../default.cf.sub' }; + inputs => { '../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/promises/autorun-def_json.cf b/tests/acceptance/promises/autorun-def_json.cf index 90afc216cf..fb1932a119 100644 --- a/tests/acceptance/promises/autorun-def_json.cf +++ b/tests/acceptance/promises/autorun-def_json.cf @@ -5,7 +5,7 @@ ####################################################### body common control { - inputs => { '../default.cf.sub' }; + inputs => { '../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/promises/autorun.cf b/tests/acceptance/promises/autorun.cf index 4c05a9e619..911e0da7ad 100644 --- a/tests/acceptance/promises/autorun.cf +++ b/tests/acceptance/promises/autorun.cf @@ -5,7 +5,7 @@ ####################################################### body common control { - inputs => { '../default.cf.sub' }; + inputs => { '../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } diff --git a/tests/acceptance/promises/promises.cf b/tests/acceptance/promises/promises.cf index 60b79aca09..7b61d0fec0 100644 --- a/tests/acceptance/promises/promises.cf +++ b/tests/acceptance/promises/promises.cf @@ -5,7 +5,7 @@ ####################################################### body common control { - inputs => { '../default.cf.sub' }; + inputs => { '../default.sub.cf' }; bundlesequence => { default("$(this.promise_filename)") }; version => "1.0"; } From 33b2dd77fd8a6cbffe174c9f4bd8e7353cc9afd0 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Wed, 6 May 2026 16:40:12 +0200 Subject: [PATCH 7/8] tests: Added GH Action for running cfengine lint Co-authored-by: Claude Opus 4.7 (1M context) Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit c3427f168a487a03f2bb6336421c2fa6a4bd42de) --- .github/workflows/cfengine_lint.yml | 20 ++++++++++++++++++++ .github/workflows/ci.yml | 4 +++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cfengine_lint.yml diff --git a/.github/workflows/cfengine_lint.yml b/.github/workflows/cfengine_lint.yml new file mode 100644 index 0000000000..2190a92839 --- /dev/null +++ b/.github/workflows/cfengine_lint.yml @@ -0,0 +1,20 @@ +name: Lint policy with CFEngine CLI +on: + workflow_call: +permissions: + contents: read +jobs: + lint: + runs-on: ubuntu-24.04 + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.14" + - name: Checkout masterfiles + uses: actions/checkout@v4 + - name: Install CFEngine CLI + run: pipx install cfengine + - name: Run cfengine lint + run: | + cfengine lint --strict no ./ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 367b031ce5..c957ad52a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,10 @@ on: jobs: style_check: uses: ./.github/workflows/style_check.yml + cfengine_lint: + uses: ./.github/workflows/cfengine_lint.yml bootstrap_policy_run_check: - needs: style_check + needs: [style_check, cfengine_lint] uses: ./.github/workflows/bootstrap_policy_run_check.yml tests: needs: bootstrap_policy_run_check From 0426db3454bb43e5e8325e3de0f272a9a811bf68 Mon Sep 17 00:00:00 2001 From: Ole Herman Schumacher Elgesem Date: Fri, 20 Mar 2026 19:22:28 +0100 Subject: [PATCH 8/8] Fixed inconsistencies found by cfengine lint Signed-off-by: Ole Herman Schumacher Elgesem (cherry picked from commit 1eb093203eb68b4a1e2155d2310acd825b80290b) --- cfbs.json | 2 +- cfe_internal/enterprise/CFE_hub_specific.cf | 4 ++-- .../enterprise/federation/federation.cf | 4 ++-- cfe_internal/enterprise/ha/ha_info.json | 23 ++++++++----------- cfe_internal/recommendations.cf | 2 +- inventory/README.md | 2 +- inventory/any.cf | 4 ++-- .../acceptance/lib/files/append_user_field.cf | 2 +- 8 files changed, 20 insertions(+), 23 deletions(-) diff --git a/cfbs.json b/cfbs.json index dfa3ead214..fb478269eb 100644 --- a/cfbs.json +++ b/cfbs.json @@ -1,5 +1,5 @@ { - "name": "Masterfiles", + "name": "masterfiles", "description": "Official CFEngine Masterfiles Policy Framework (MPF)", "type": "module", "provides": { diff --git a/cfe_internal/enterprise/CFE_hub_specific.cf b/cfe_internal/enterprise/CFE_hub_specific.cf index c0f436c883..6a22c50dcc 100644 --- a/cfe_internal/enterprise/CFE_hub_specific.cf +++ b/cfe_internal/enterprise/CFE_hub_specific.cf @@ -607,7 +607,7 @@ bundle agent log_cfengine_enterprise_license_utilization } -bundle agent cfe_internal_enterprise_HA_classes +bundle agent cfe_internal_enterprise_ha_classes { classes: # NOTE The `hub_active` class is a hard class defined by the ha_plugin in @@ -645,7 +645,7 @@ bundle agent cfe_internal_enterprise_maintenance enterprise_edition:: "HA classes" - usebundle => "cfe_internal_enterprise_HA_classes", + usebundle => "cfe_internal_enterprise_ha_classes", comment => "Set the HA-related classes for the maintenance bundles"; "Enterprise Maintenance" diff --git a/cfe_internal/enterprise/federation/federation.cf b/cfe_internal/enterprise/federation/federation.cf index 1a32e20759..3e1c406229 100644 --- a/cfe_internal/enterprise/federation/federation.cf +++ b/cfe_internal/enterprise/federation/federation.cf @@ -809,9 +809,9 @@ bundle agent ensure_feeders arglist => { "cfdb", @if minimum_version(3.24) - "select ensure_feeders($(feeders_arg));" + "select ensure_feeders($(feeders_arg));", @else - `"select ensure_feeders($(feeders_arg));"` + `"select ensure_feeders($(feeders_arg));"`, @endif }, classes => psql_wrapper_exit_codes, diff --git a/cfe_internal/enterprise/ha/ha_info.json b/cfe_internal/enterprise/ha/ha_info.json index 786e3ee31e..2e3b749363 100644 --- a/cfe_internal/enterprise/ha/ha_info.json +++ b/cfe_internal/enterprise/ha/ha_info.json @@ -1,15 +1,12 @@ { - "192.168.100.10": - { - "sha": "PLACE KEY HERE", - "internal_ip": "192.168.100.10", - "is_in_cluster" : true, - }, - "192.168.100.11": - { - "sha": "PLACE KEY HERE", - "internal_ip": "192.168.100.11", - "is_in_cluster" : true, - } + "192.168.100.10": { + "sha": "PLACE KEY HERE", + "internal_ip": "192.168.100.10", + "is_in_cluster": true + }, + "192.168.100.11": { + "sha": "PLACE KEY HERE", + "internal_ip": "192.168.100.11", + "is_in_cluster": true + } } - diff --git a/cfe_internal/recommendations.cf b/cfe_internal/recommendations.cf index a33b2eb809..ec6d458a5d 100644 --- a/cfe_internal/recommendations.cf +++ b/cfe_internal/recommendations.cf @@ -1,4 +1,4 @@ -bundle agent MPF_class_recommendations +bundle agent mpf_class_recommendations { meta: (policy_server|am_policy_hub).enterprise_edition:: diff --git a/inventory/README.md b/inventory/README.md index 4c7f745dcf..d35da46ce6 100644 --- a/inventory/README.md +++ b/inventory/README.md @@ -183,7 +183,7 @@ R: inventory_lsb: OS = Ubuntu, codename = trusty, release = 14.04, flavor = Ubun * lives in: `any.cf` * runs `inventory_control.lldpctl_exec` through a Perl filter -* provides variables: `cfe_autorun_inventory_LLDP.K` for each `K` returned by the LLDB executable +* provides variables: `cfe_autorun_inventory_lldp.K` for each `K` returned by the LLDB executable ## mtab diff --git a/inventory/any.cf b/inventory/any.cf index e3e0a58b92..ad536f76b3 100644 --- a/inventory/any.cf +++ b/inventory/any.cf @@ -37,7 +37,7 @@ bundle agent inventory_autorun { methods: !disable_inventory_LLDP:: - "LLDP" usebundle => cfe_autorun_inventory_LLDP(), + "LLDP" usebundle => cfe_autorun_inventory_lldp(), handle => "cfe_internal_autorun_inventory_LLDP"; !disable_inventory_package_refresh:: @@ -1066,7 +1066,7 @@ bundle agent cfe_autorun_inventory_dmidecode "DEBUG $(this.bundle): Obtained Physical memory (MB) = '$(total_physical_memory_MB)'"; } -bundle agent cfe_autorun_inventory_LLDP +bundle agent cfe_autorun_inventory_lldp # @brief Do LLDP-based inventory # # This agent bundle runs lldpctl to discover information. See diff --git a/tests/acceptance/lib/files/append_user_field.cf b/tests/acceptance/lib/files/append_user_field.cf index ca0ca5117d..eadf7631fa 100644 --- a/tests/acceptance/lib/files/append_user_field.cf +++ b/tests/acceptance/lib/files/append_user_field.cf @@ -48,7 +48,7 @@ bundle agent check "fail" usebundle => dcs_fail( $(this.promise_filename) ), - ifvarclass => "_fail"; + if => "_fail"; pass:: "pass"