bundle common test_meta
{
  vars:
      "description" string => "A user present gets removed (dry run)";
      "story_id" string => "5526";
      "covers" string => "dryrun_repaired";
}

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

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

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

bundle agent init
{
  users:
    "johndoe"
      policy => "present";
}

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

bundle agent test
{
  users:
    "johndoe"
      action => test_action,
      policy => "absent";
}

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

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

bundle agent check
{
  methods:
    "any" usebundle => user_exists("johndoe", "success", "failure"),
      classes => always("methods_run");

  classes:
      "ready" expression => "methods_run";
      "ok" and => { "success", "!failure" };

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