######################################################
#
#  Issue 375 setup (precursor to actual tickle of bug)
#
#####################################################
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

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

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

#######################################################
bundle agent test
{
  files:
    "$(G.testfile)"
      move_obstructions => "true",
      link_from => test_link;

  meta:
    "test_suppress_fail"
      string => "windows",
      meta => { "redmine4608" };
}

body link_from test_link
{
  source => "$(G.testfile).SOURCE";
  link_type => "hardlink";
}

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

  reports:
    DEBUG::
      "This test should pass as a precursor to a bunch of related failures";

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

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