# Check that reports are printed just once (Redmine#3446 https://cfengine.com/dev/issues/3446)

body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

bundle agent init
{

}


bundle agent test
{
vars:
  "subout" string => execresult("$(sys.cf_agent) -Kf $(this.promise_filename).sub", "noshell");
}


bundle agent check
{
classes:
      "ok1" expression => regcmp(".*9b70d955f7e126bc082e4a99eb2b3d08e4ebc29a.*", "$(test.subout)");
      "ok2" expression => regcmp(".*18a307169ff8a691607846c8a19c361a37695773.*", "$(test.subout)");
      "ok3" expression => regcmp(".*79815eefd0b619c6b875edf68adc7ef0e00c1ad3.*", "$(test.subout)");

      "ok" and => { "ok1", "ok2", "ok3" };

reports:
  DEBUG::
    "Output from subtest: $(test.subout)";

  ok::
    "$(this.promise_filename) Pass";
  !ok::
    "$(this.promise_filename) FAIL";
}
### PROJECT_ID: core
### CATEGORY_ID: 2
