##############################################################################
#
# Redmine #2936: Check that list variables under reserved scope expand
# as they should in reports promises.
#
##############################################################################

body common control
{
  inputs => { "../../default.cf.sub" };
  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
{
  # If the output contains the string "$(sys.hardware_addresses)" then we
  # failed to expand the variable!
  classes:
    "ok" not => regcmp(".*hardware_addresses.*", "$(test.subout)");

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

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