bundle common test_meta
{
  vars:
    "description"
      string => "Test that --dry-run restricts mustache template rendering";

    "story_id" string => "5535";
    "covers" string => "dryrun_repaired";
}

# Ref: https://dev.cfengine.com/issues/6739
#######################################################
body common control
{
  inputs => { "../default.sub.cf" };
  bundlesequence => { default("$(this.promise_filename)") };
  version => "1.0";
}

bundle agent init
{
  vars:
    "template_target" string => "$(G.testfile)";

  files:
    "$(template_target)" create => "true";
}

#######################################################
bundle agent check
{
  vars:
    "command"
      string => "$(sys.cf_agent) --dry-run -KIf $(this.promise_filename).sub -DAUTO";

  methods:
    "check"
      usebundle => dcs_passif_output(
        ".*Pass.*", ".*FAIL.*", $(command), $(this.promise_filename)
      );
}
