1bundle common test_meta
2{
3  vars:
4      "description" string => "A user removed does not get the home bundle run";
5      "story_id" string => "5526";
6      "covers" string => "operational_repaired";
7}
8
9#######################################################
10
11body common control
12{
13      inputs => { "../../default.cf.sub", "user_queries.cf.sub" };
14      bundlesequence  => { default("$(this.promise_filename)") };
15}
16
17#######################################################
18
19bundle agent init
20{
21  users:
22    "johndoe"
23      policy => "present";
24}
25
26#######################################################
27
28bundle agent test
29{
30  users:
31    "johndoe"
32      policy => "absent",
33      home_bundle => home_bundle("/home/johndoe");
34}
35
36bundle agent home_bundle(x)
37{
38  files:
39    "$(G.testfile)"
40      create => "true",
41      edit_line => home_edit("$(x)");
42}
43
44bundle edit_line home_edit(x)
45{
46  insert_lines:
47    "$(x)";
48}
49
50#######################################################
51
52bundle agent check
53{
54  classes:
55    "ok" expression => strcmp("0", countlinesmatching("/home/johndoe", "$(G.testfile)"));
56
57  reports:
58    ok::
59      "$(this.promise_filename) Pass";
60    !ok::
61      "$(this.promise_filename) FAIL";
62}
63