# Redmine#4889: avoid unresolved variables in promiser or attributes

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 -DAUTO,DEBUG 2>&1 | $(G.grep) PURPLE_DINOSAUR", "useshell");
}

bundle agent check
{
  classes:
      "ok" not => regcmp("PURPLE_DINOSAUR", $(test.subout));

  reports:
    ok.EXTRA::
      "The output was OK: $(test.subout)";
    !ok.DEBUG::
      "The output was NOT OK: $(test.subout)";
    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}
