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
8435fbc
tests: Added errorexit acceptance tests to GH Actions
olehermanse May 6, 2026
5844e82
CFE-4526: testall egrep & fgrep warnings
sarakthon Jul 24, 2026
3a41e76
CFE-3041: change regular acceptance test to .error.cf
sarakthon Aug 25, 2026
fdc5863
Added new type of test to testall - errorpass
olehermanse Oct 7, 2026
9b05468
Moved acceptance test to error.pass.cf test
olehermanse Oct 7, 2026
1b842fd
Fix errorpass test(?)
olehermanse Oct 7, 2026
811c86b
Enabled errorpass tests in GH Actions
olehermanse Oct 7, 2026
d9c9d41
Made testall fail regular acceptance tests which log errors
aleksandrychev Oct 14, 2026
51c5439
Added fileexists() guards to file reads in acceptance tests
aleksandrychev Oct 15, 2026
90b53dc
Indented command output in dcs_passif_output() DEBUG report
aleksandrychev Oct 15, 2026
f4233ec
Added guards to reads of files created later in acceptance tests
aleksandrychev Oct 15, 2026
618e0f0
Renamed 00_basics/def.json test directory to def_json
aleksandrychev Oct 15, 2026
584adc1
Fixed execresult_action_immediate.cf logging errors
aleksandrychev Oct 15, 2026
56d3749
Fixed classic_evaluation_custom_promise_types.cf logging errors
aleksandrychev Oct 15, 2026
d7b67f1
Fixed wrong-bundle-type.cf and ifelse.cf logging errors
aleksandrychev Oct 15, 2026
edd53e2
Renamed acceptance tests which log errors on purpose to .error.pass.cf
aleksandrychev Oct 15, 2026
506d433
Fixed linting issues
aleksandrychev Oct 15, 2026
4fda97e
Fixed unsafe and check_syntax.cf acceptance tests logging errors
nickanderson Oct 22, 2026
9536faa
Fixed formatting of acceptance tests
nickanderson Oct 22, 2026
2d91fc4
Fixed mapdata_json_pipe.cf logging errors
nickanderson Oct 23, 2026
244c09a
Made .error.pass.cf tests respect soft fails and skips
aleksandrychev Oct 26, 2026
eaa665d
Fixed diff_mode_ownership.cf logging errors
nickanderson Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/acceptance_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
run: |
cd tests/acceptance
chmod -R go-w .
./testall --printlog --tests=common,errorlog
./testall --printlog --tests=common,errorlog,errorexit,errorpass
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# fixes https://dev.cfengine.com/issues/2504
# using variables in string contexts
#
# This is an .error.pass.cf test, because the 'cf engine' class context
# (words separated by whitespace without an operator) is invalid on
# purpose and logs an error.
body common control
{
inputs => { "../../default.sub.cf" };
Expand Down
6 changes: 5 additions & 1 deletion tests/acceptance/00_basics/04_bundles/wrong-bundle-type.cf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ bundle agent test
"${sys.cf_agent} -Kf $(this.promise_dirname)/wrong-bundle-type.sub.x.cf",
"noshell"
);

# Indent the output in the DEBUG report, so that errors printed by the
# sub-agent are not mistaken for errors of this test by testall
"subout_indented" string => regex_replace($(subout), "^", " | ", "gm");
}

bundle agent check
Expand All @@ -29,7 +33,7 @@ bundle agent check

reports:
DEBUG::
"$(test.subout)";
"$(test.subout_indented)";

ok::
"$(this.promise_filename) Pass";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# Test that 'classes' body works on 'vars' promises
#
# This is an .error.pass.cf test, because execresult() of the
# non-existent '/nonexisting' fails on purpose and logs errors, to test
# that repair_failed classes are set.
#
#######################################################
body common control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#
# Test that it is invalid to define variables in remote bundles
#
# This is an .error.pass.cf test, because defining a variable in a
# remote bundle is rejected with errors, which is what this test checks
# (CFE-1915).
#
#######################################################
body common control
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ bundle agent test
{
vars:
"cf_promises_validated"
data => readjson("$(G.testfile).$(this.promiser)", 1K);
data => readjson("$(G.testfile).$(this.promiser)", 1K),
if => fileexists("$(G.testfile).$(this.promiser)");

"printable" string => format("%S", "cf_promises_validated");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
#
# Test diskfree()
#
# This is an .error.pass.cf test, because diskfree() is called on the
# non-existent path '/lkjqeroiu' on purpose and logs an error.
#
#######################################################
body common control
{
Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/011.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/012.cf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/013.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/014.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\.", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\.", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/015.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/016.cf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/017.cf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/018.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/019.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "X", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "X", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/020.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", "\s", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", "\s", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/021.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" slist => readstringlist("$(G.testfile)", "NoComment", ",", 5, 100);
"nums"
slist => readstringlist("$(G.testfile)", "NoComment", ",", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/024.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/025.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/026.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/027.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\.", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\.", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/028.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/029.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/030.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/031.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/032.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "X", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "X", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/033.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", "\s", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", "\s", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/034.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" ilist => readintlist("$(G.testfile)", "NoComment", ",", 5, 100);
"nums"
ilist => readintlist("$(G.testfile)", "NoComment", ",", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/037.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/038.cf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/039.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100);
"nums"
rlist => readreallist("$(G.testfile)", "NoComment", "\s+", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
5 changes: 4 additions & 1 deletion tests/acceptance/01_vars/02_functions/040.cf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ body delete init_delete
bundle agent test
{
vars:
"nums" rlist => readreallist("$(G.testfile)", "NoComment", "\.", 5, 100);
"nums"
rlist => readreallist("$(G.testfile)", "NoComment", "\.", 5, 100),
if => fileexists("$(G.testfile)");

"sum" real => sum("nums");
}

Expand Down
Loading
Loading