Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_collectd.aug
1 (*
2 Module: Test_Collectd
3   Provides unit tests and examples for the <Collectd> lens.
4 *)
5 module Test_Collectd =
6
7 (* Variable: simple *)
8 let simple = "LoadPlugin contextswitch
9 LoadPlugin cpu
10 FQDNLookup \"true\"
11 Include \"/var/lib/puppet/modules/collectd/plugins/*.conf\"
12 "
13
14 (* Test: Collectd.lns *)
15 test Collectd.lns get simple =
16   { "directive" = "LoadPlugin"
17     { "arg" = "contextswitch" }
18   }
19   { "directive" = "LoadPlugin"
20     { "arg" = "cpu" }
21   }
22   { "directive" = "FQDNLookup"
23     { "arg" = "\"true\"" }
24   }
25   { "directive" = "Include"
26     { "arg" = "\"/var/lib/puppet/modules/collectd/plugins/*.conf\"" }
27   }
28
29
30 (* Variable: filters *)
31 let filters = "<Chain \"PreCache\">
32        <Rule \"no_fqdn\">
33                <Match \"regex\">
34                        Host \"^[^\.]*$\"
35                        Invert false
36                </Match>
37                Target \"stop\"
38        </Rule>
39 </Chain>
40 "
41
42
43 (* Test: Collectd.lns *)
44 test Collectd.lns get filters =
45   { "Chain"
46     { "arg" = "\"PreCache\"" }
47     { "Rule"
48       { "arg" = "\"no_fqdn\"" }
49       { "Match"
50         { "arg" = "\"regex\"" }
51         { "directive" = "Host"
52           { "arg" = "\"^[^\.]*$\"" }
53         }
54         { "directive" = "Invert"
55           { "arg" = "false" }
56         }
57       }
58       { "directive" = "Target"
59         { "arg" = "\"stop\"" }
60       }
61     }
62   }
63
64
65