#######################################################
#
# Test that printfile honors number_of_lines constraint (Issue 686)
#
#######################################################

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


bundle agent init
{
  vars:
      "dummy" string => "dummy";
}

#######################################################

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

#######################################################

bundle agent check
{
  classes:
      "firstline" expression => regcmp(".*firstline.*", "$(test.subout)");
      "nosecondline" not => regcmp(".*secondline.*", "$(test.subout)");
      "ok" and => { "firstline", "nosecondline" };

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

    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}

### PROJECT_ID: core
### CATEGORY_ID: 2
