Bump to 1.14.1
[platform/upstream/augeas.git] / lenses / tests / test_carbon.aug
1 (*
2 Module: Test_Carbon
3   Provides unit tests and examples for the <Carbon> lens.
4 *)
5
6 module Test_Carbon =
7
8 let carbon_conf = "[cache]
9 # Configure carbon directories.
10
11 # Specify the user to drop privileges to
12 # If this is blank carbon runs as the user that invokes it
13 # This user must have write access to the local data directory
14 USER =
15
16 MAX_CACHE_SIZE = inf # comment at EOL
17 LINE_RECEIVER_INTERFACE=0.0.0.0
18 LINE_RECEIVER_PORT = 2003
19 ENABLE_UDP_LISTENER = False
20
21 [relay]
22 LINE_RECEIVER_INTERFACE = 0.0.0.0
23 LINE_RECEIVER_PORT = 2013
24 PICKLE_RECEIVER_INTERFACE = 0.0.0.0
25 PICKLE_RECEIVER_PORT = 2014
26 "
27
28 test Carbon.lns get carbon_conf =
29   { "cache"
30     { "#comment" = "Configure carbon directories." }
31     { }
32     { "#comment" = "Specify the user to drop privileges to" }
33     { "#comment" = "If this is blank carbon runs as the user that invokes it" }
34     { "#comment" = "This user must have write access to the local data directory" }
35     { "USER" }
36     { }
37     { "MAX_CACHE_SIZE" = "inf"
38       { "#comment" = "comment at EOL" }
39     }
40     { "LINE_RECEIVER_INTERFACE" = "0.0.0.0" }
41     { "LINE_RECEIVER_PORT" = "2003" }
42     { "ENABLE_UDP_LISTENER" = "False" }
43     { }
44   }
45   { "relay"
46     { "LINE_RECEIVER_INTERFACE" = "0.0.0.0" }
47     { "LINE_RECEIVER_PORT" = "2013" }
48     { "PICKLE_RECEIVER_INTERFACE" = "0.0.0.0" }
49     { "PICKLE_RECEIVER_PORT" = "2014" }
50   }
51
52 let relay_rules_conf = "# You must have exactly one section with 'default = true'
53 # Note that all destinations listed must also exist in carbon.conf
54 # in the DESTINATIONS setting in the [relay] section
55 [default]
56 default = true
57 destinations = 127.0.0.1:2004:a, 127.0.0.1:2104:b
58 "
59
60 test Carbon.lns get relay_rules_conf =
61   { "#comment" = "You must have exactly one section with 'default = true'" }
62   { "#comment" = "Note that all destinations listed must also exist in carbon.conf" }
63   { "#comment" = "in the DESTINATIONS setting in the [relay] section" }
64   { "default"
65     { "default" = "true" }
66     { "destinations" = "127.0.0.1:2004:a, 127.0.0.1:2104:b" }
67   }
68
69 let storage_aggregation_conf = "# Aggregation methods for whisper files. Entries are scanned in order,
70 # and first match wins. This file is scanned for changes every 60 seconds
71 [max]
72 pattern = \.max$
73 xFilesFactor = 0.1
74 aggregationMethod = max
75 "
76
77 test Carbon.lns get storage_aggregation_conf =
78   { "#comment" = "Aggregation methods for whisper files. Entries are scanned in order," }
79   { "#comment" = "and first match wins. This file is scanned for changes every 60 seconds" }
80   { "max"
81     { "pattern" = "\.max$" }
82     { "xFilesFactor" = "0.1" }
83     { "aggregationMethod" = "max" }
84   }