######################################################
#
#  Issue 375
#
#####################################################
# This test falls out of the usual test-syntax, because 1) It is designed to
# fail and 2) Two of the set of tests requires a non-standard bundlesequence

body common control
{
      inputs => { "../../default.cf.sub" };
      bundlesequence  => { init, test("banana"), check };   
      version => "1.0";
}

bundle agent init
{
  files:
      "$(G.testfile)"
      delete => init_delete;
}

body delete init_delete
{
      dirlinks => "delete";
      rmdirs   => "true";
}

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

bundle agent test(val)
{
  files:
      "$(G.testfile)"
      create => "true",
      action => test_action("$(val)");
}

body action test_action(type)
{
      log_priority => "$(type)";
}

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

bundle agent check
{
  classes:
      "ok" not => fileexists("$(G.testfile)");

  reports:
    DEBUG::
      "This test should fail";
    ok::
      "$(this.promise_filename) Pass";
    !ok::
      "$(this.promise_filename) FAIL";
}
