#######################################################
#
# Subdirectories shall not be created when action is
# warn. Related to bug #926.
#
#######################################################
body common control
{
  inputs => { "../../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

#######################################################
bundle agent init
{
  vars:
}

#######################################################
bundle agent test
{
  files:
    "$(G.testdir)/subdir/mylink"
      link_from => ln_s("$(G.testdir)/sourcefile"),
      action => test_warn_only;
}

body action test_warn_only
{
  action_policy => "warn";
}

body link_from ln_s(x)
{
  link_type => "symlink";
  source => "$(x)";
  when_no_source => "force";
}

#######################################################
bundle agent check
{
  classes:
    "subdir_created" expression => fileexists("$(G.testdir)/subdir");

  reports:
    !subdir_created::
      "$(this.promise_filename) Pass";

    subdir_created::
      "$(this.promise_filename) Fail";
}

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