#######################################################
#
# Test that action => "warn" works correctly for rename => disable (Issue 841)
#
#######################################################

body common control
{
      inputs => { "../../default.sub.cf" };
      bundlesequence  => { default("$(this.promise_filename)") };
      version => "1.0";
}


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

bundle agent init
{
  files:
      "$(G.testfile)"
      move_obstructions => "true",
      copy_from => init_copy;
}

body copy_from init_copy
{
      source => "$(G.etc_null)";
      compare => "digest";
}

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

bundle agent test
{
  files:
      "$(G.testfile)"
      rename => disable,
      action => warn_only;
}

body rename disable
{
      disable => "true";
}

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

bundle agent check
{
  classes:
      "filestillthere" expression => fileexists("$(G.testfile)");
      "fileisnotdisabled" not => fileexists("$(G.testfile).cfdisabled");

      "ok" and => { "filestillthere", "fileisnotdisabled" };

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

### PROJECT_ID: core
### CATEGORY_ID: 27
