Imported Upstream version 1.8.0
[platform/upstream/augeas.git] / lenses / tests / test_chrony.aug
1 (*
2 Module: Test_Chrony
3   Provides unit tests and examples for the <Chrony> lens.
4 *)
5
6 module Test_Chrony =
7
8   let exampleconf = "# Comment
9 #Comment
10 ! Comment
11 !Comment
12 ; Comment
13 ;Comment
14 % Comment
15 %Comment
16
17 server ntp1.example.com
18 server ntp2.example.com iburst
19 server ntp3.example.com presend 2
20 server ntp4.example.com offline polltarget 4
21 server ntp5.example.com maxdelay 2 offline
22 server ntp6.example.com maxdelay 2 iburst presend 2 xleave offset 1e-4
23 server ntp7.example.com iburst presend 2 offline prefer trust require
24 server ntp8.example.com minsamples 8 maxsamples 16 version 3
25 peer ntpc1.example.com
26 pool pool1.example.com iburst maxsources 3
27 allow
28 deny all
29 cmdallow 192.168.1.0/24
30 cmddeny all 192.168.2.0/24
31 stratumweight 0
32         driftfile /var/lib/chrony/drift
33         rtcsync
34 makestep 10 -1
35 bindcmdaddress 127.0.0.1
36 bindcmdaddress ::1
37 local
38 local stratum 10
39 local distance 1.0 orphan
40 keyfile /etc/chrony.keys
41 commandkey 1
42 generatecommandkey
43 manual
44 noclientlog
45 logchange 0.5
46 logdir /var/log/chrony
47 log rtc measurements rawmeasurements statistics tracking refclocks tempcomp
48 leapsectz right/UTC
49 broadcast 10 192.168.1.255
50 broadcast 10 192.168.100.255 123
51 fallbackdrift 16 19
52 mailonchange root@localhost 0.5
53 maxchange 1000 1 2
54 maxdistance 1.0
55 maxdrift 100
56 hwtimestamp eth0 minpoll -2 txcomp 300e-9 rxcomp 645e-9 nocrossts
57 initstepslew 30 foo.bar.com
58 initstepslew 30 foo.bar.com baz.quz.com
59 ratelimit interval 4 burst 16 leak 2
60 cmdratelimit
61 refclock SHM 0 refid SHM0 delay 0.1 offset 0.2 noselect
62 refclock PPS /dev/pps0 dpoll 2 poll 3 lock SHM0 rate 5 minsamples 8
63 smoothtime 400 0.001 leaponly
64 tempcomp /sys/class/hwmon/hwmon0/temp2_input 30 26000 0.0 0.000183 0.0
65 tempcomp /sys/class/hwmon/hwmon0/temp2_input 30 /etc/chrony.tempcomp
66 ntpsigndsocket /var/lib/samba/ntp_signd
67 "
68
69   test Chrony.lns get exampleconf =
70     { "#comment" = "Comment" }
71   { "#comment" = "Comment" }
72   { "#comment" = "Comment" }
73   { "#comment" = "Comment" }
74   { "#comment" = "Comment" }
75   { "#comment" = "Comment" }
76   { "#comment" = "Comment" }
77   { "#comment" = "Comment" }
78   {  }
79   { "server" = "ntp1.example.com" }
80   { "server" = "ntp2.example.com"
81     { "iburst" }
82   }
83   { "server" = "ntp3.example.com"
84     { "presend" = "2" }
85   }
86   { "server" = "ntp4.example.com"
87     { "offline" }
88     { "polltarget" = "4" }
89   }
90   { "server" = "ntp5.example.com"
91     { "maxdelay" = "2" }
92     { "offline" }
93   }
94   { "server" = "ntp6.example.com"
95     { "maxdelay" = "2" }
96     { "iburst" }
97     { "presend" = "2" }
98     { "xleave" }
99     { "offset" = "1e-4" }
100   }
101   { "server" = "ntp7.example.com"
102     { "iburst" }
103     { "presend" = "2" }
104     { "offline" }
105     { "prefer" }
106     { "trust" }
107     { "require" }
108   }
109   { "server" = "ntp8.example.com"
110     { "minsamples" = "8" }
111     { "maxsamples" = "16" }
112     { "version" = "3" }
113   }
114   { "peer" = "ntpc1.example.com" }
115   { "pool" = "pool1.example.com"
116     { "iburst" }
117     { "maxsources" = "3" }
118   }
119   { "allow" }
120   { "deny"
121     { "all" }
122   }
123   { "cmdallow" = "192.168.1.0/24" }
124   { "cmddeny" = "192.168.2.0/24"
125     { "all" }
126   }
127   { "stratumweight" = "0" }
128   { "driftfile" = "/var/lib/chrony/drift" }
129   { "rtcsync" }
130   { "makestep"
131     { "threshold" = "10" }
132     { "limit" = "-1" }
133   }
134   { "bindcmdaddress" = "127.0.0.1" }
135   { "bindcmdaddress" = "::1" }
136   { "local" }
137   { "local"
138     { "stratum" = "10" }
139   }
140   { "local"
141     { "distance" = "1.0" }
142     { "orphan" }
143   }
144   { "keyfile" = "/etc/chrony.keys" }
145   { "commandkey" = "1" }
146   { "generatecommandkey" }
147   { "manual" }
148   { "noclientlog" }
149   { "logchange" = "0.5" }
150   { "logdir" = "/var/log/chrony" }
151   { "log"
152     { "rtc" }
153     { "measurements" }
154     { "rawmeasurements" }
155     { "statistics" }
156     { "tracking" }
157     { "refclocks" }
158     { "tempcomp" }
159   }
160   { "leapsectz" = "right/UTC" }
161   { "broadcast"
162     { "interval" = "10" }
163     { "address" = "192.168.1.255" }
164   }
165   { "broadcast"
166     { "interval" = "10" }
167     { "address" = "192.168.100.255" }
168     { "port" = "123" }
169   }
170   { "fallbackdrift"
171     { "min" = "16" }
172     { "max" = "19" }
173   }
174   { "mailonchange"
175     { "emailaddress" = "root@localhost" }
176     { "threshold" = "0.5" }
177   }
178   { "maxchange"
179     { "threshold" = "1000" }
180     { "delay" = "1" }
181     { "limit" = "2" }
182   }
183   { "maxdistance" = "1.0" }
184   { "maxdrift" = "100" }
185   { "hwtimestamp"
186     { "interface" = "eth0" }
187     { "minpoll" = "-2" }
188     { "txcomp" = "300e-9" }
189     { "rxcomp" = "645e-9" }
190     { "nocrossts" }
191   }
192   { "initstepslew"
193     { "threshold" = "30" }
194     { "address" = "foo.bar.com" }
195   }
196   { "initstepslew"
197     { "threshold" = "30" }
198     { "address" = "foo.bar.com" }
199     { "address" = "baz.quz.com" }
200   }
201   { "ratelimit"
202     { "interval" = "4" }
203     { "burst" = "16" }
204     { "leak" = "2" }
205   }
206   { "cmdratelimit" }
207   { "refclock"
208     { "driver" = "SHM" }
209     { "parameter" = "0" }
210     { "refid" = "SHM0" }
211     { "delay" = "0.1" }
212     { "offset" = "0.2" }
213     { "noselect" }
214   }
215   { "refclock"
216     { "driver" = "PPS" }
217     { "parameter" = "/dev/pps0" }
218     { "dpoll" = "2" }
219     { "poll" = "3" }
220     { "lock" = "SHM0" }
221     { "rate" = "5" }
222     { "minsamples" = "8" }
223   }
224   { "smoothtime"
225     { "maxfreq" = "400" }
226     { "maxwander" = "0.001" }
227     { "leaponly" }
228   }
229   { "tempcomp"
230     { "sensorfile" = "/sys/class/hwmon/hwmon0/temp2_input" }
231     { "interval" = "30" }
232     { "t0" = "26000" }
233     { "k0" = "0.0" }
234     { "k1" = "0.000183" }
235     { "k2" = "0.0" }
236   }
237   { "tempcomp"
238     { "sensorfile" = "/sys/class/hwmon/hwmon0/temp2_input" }
239     { "interval" = "30" }
240     { "pointfile" = "/etc/chrony.tempcomp" }
241   }
242   { "ntpsigndsocket" = "/var/lib/samba/ntp_signd" }
243
244
245 (* Local Variables: *)
246 (* mode: caml       *)
247 (* End:             *)