#######################################################
#
# Redmine#3315: Test dynamic inputs and bundlesequence
#
#######################################################
body common control
{
  inputs => { "../../default.sub.cf", @(dynamic.inputs) };
  bundlesequence => { dynamic, default("$(this.promise_filename)") };
  version => "1.0";
}

#######################################################
bundle agent dynamic
{
  vars:
    "todo" slist => bundlesmatching(".*included");
    "inputs" slist => findfiles("$(this.promise_filename).[s][u][b]");

  methods:
    "run" usebundle => $(todo);

  reports:
    DEBUG::
      "Found dynamic bundle: $(todo)";
}

bundle agent init
{
}

bundle agent test
{
}

bundle agent check
{
  classes:
    "ok" expression => "class_defined_from_included_bundle";

  reports:
    ok::
      "$(this.promise_filename) Pass";

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