body file control
{
  inputs => { "$(sys.policy_entry_dirname)/../common.cf.sub" };
}

bundle common testcase
{
  vars:
    "filename" string => "$(this.promise_filename)";
}

bundle agent setup
{
  files:
    "$(G.testfile)"
      edit_line => insert_lines(
        "
foo 1
bar 2
baz 3
me:x:1001:1001::/home/me:/bin/sh
"
      ),
      create => "true";
}

bundle agent main
{
  files:
    "$(G.testfile)" edit_line => delete_lines_matching("foo 1");
}

bundle agent teardown
{
  reports:
    "Edited file has contents: " printfile => my_cat($(G.testfile));
}

body printfile my_cat(file)
# @brief Report the contents of a file
# @param file The full path of the file to report
{
  file_to_print => "$(file)";
  number_of_lines => "inf";
}
