# Test that bundlesmatching works correctly for dynamic sequences
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)"), @(init.runs) };
}

bundle common init
{
  vars:
    "runs" slist => bundlesmatching("default:run.*");
}

bundle agent test
{
}

bundle agent check
{
  classes:
    "ok" and => { ok1, ok2, ok3 };

  reports:
    DEBUG::
      "Found bundles $(test.runs)";

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

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

bundle agent run_123_456
{
  classes:
    "ok1"
      expression => "any",
      scope => "namespace";
}

bundle agent run_789_0ab
{
  classes:
    "ok2"
      expression => "any",
      scope => "namespace";
}

bundle agent run_cde_fgh
{
  classes:
    "ok3"
      expression => "any",
      scope => "namespace";
}
