Imported Upstream version 1.7.0
[platform/upstream/augeas.git] / lenses / tests / test_up2date.aug
1 (*
2 Module: Test_Up2date
3   Provides unit tests and examples for the <Up2date> lens.
4 *)
5
6 module Test_Up2date =
7
8 (* Variable: empty *)
9 let empty = "keyword=
10 "
11 test Up2date.lns get empty =
12   { "1" = "keyword" }
13
14 (* Variable: list_empty *)
15 let list_empty = "keyword=;
16 "
17 test Up2date.lns get list_empty =
18   { "1" = "keyword"
19     { "values" } }
20
21 (* Variable: list_one *)
22 let list_one = "keyword=foo;
23 "
24 test Up2date.lns get list_one =
25   { "1" = "keyword"
26     { "values"
27       { "1" = "foo" } } }
28
29 (* Variable: list_two
30    Probably not useful, up2date throws "bar" away *)
31 let list_two = "keyword=foo;bar
32 "
33 test Up2date.lns get list_two =
34   { "1" = "keyword"
35     { "values"
36       { "1" = "foo" }
37       { "2" = "bar" } } }
38
39 (* Variable: list_two_trailing *)
40 let list_two_trailing = "keyword=foo;bar;
41 "
42 test Up2date.lns get list_two_trailing =
43   { "1" = "keyword"
44     { "values"
45       { "1" = "foo" }
46       { "2" = "bar" } } }
47
48 (* Variable: conf *)
49 let conf = "# Red Hat Update Agent config file.
50 # Format: 1.0
51
52 debug[comment]=Whether or not debugging is enabled
53 debug=0
54
55 systemIdPath[comment]=Location of system id
56 systemIdPath=/etc/sysconfig/rhn/systemid
57
58 serverURL[comment]=Remote server URL (use FQDN)
59 #serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC
60 serverURL=https://enter.your.server.url.here/XMLRPC
61
62 hostedWhitelist[comment]=RHN Hosted URL's
63 hostedWhitelist=
64
65 enableProxy[comment]=Use a HTTP Proxy
66 enableProxy=0
67
68 versionOverride[comment]=Override the automatically determined system version
69 versionOverride=
70
71 httpProxy[comment]=HTTP proxy in host:port format, e.g. squid.redhat.com:3128
72 httpProxy=
73
74 noReboot[comment]=Disable the reboot actions
75 noReboot=0
76
77 networkRetries[comment]=Number of attempts to make at network connections before giving up
78 networkRetries=1
79
80 disallowConfChanges[comment]=Config options that can not be overwritten by a config update action
81 disallowConfChanges=noReboot;sslCACert;useNoSSLForPackages;noSSLServerURL;serverURL;disallowConfChanges;
82
83 sslCACert[comment]=The CA cert used to verify the ssl server
84 sslCACert=/usr/share/rhn/RHNS-CA-CERT
85
86 # Akamai does not support http protocol, therefore setting this option as side effect disable \"Location aware\" function
87 useNoSSLForPackages[comment]=Use the noSSLServerURL for package, package list, and header fetching (disable Akamai)
88 useNoSSLForPackages=0
89
90 retrieveOnly[comment]=Retrieve packages only
91 retrieveOnly=0
92
93 skipNetwork[comment]=Skips network information in hardware profile sync during registration.
94 skipNetwork=0
95
96 tmpDir[comment]=Use this Directory to place the temporary transport files
97 tmpDir=/tmp
98
99 writeChangesToLog[comment]=Log to /var/log/up2date which packages has been added and removed
100 writeChangesToLog=0
101
102 stagingContent[comment]=Retrieve content of future actions in advance
103 stagingContent=1
104
105 stagingContentWindow[comment]=How much forward we should look for future actions. In hours.
106 stagingContentWindow=24
107 "
108
109 (* Test: Up2date.lns *)
110 test Up2date.lns get conf =
111   { "#comment" = "Red Hat Update Agent config file." }
112   { "#comment" = "Format: 1.0" }
113   {  }
114   { "1" = "debug[comment]"
115     { "value" = "Whether or not debugging is enabled" } }
116   { "2" = "debug"
117     { "value" = "0" } }
118   {  }
119   { "3" = "systemIdPath[comment]"
120     { "value" = "Location of system id" } }
121   { "4" = "systemIdPath"
122     { "value" = "/etc/sysconfig/rhn/systemid" } }
123   {  }
124   { "5" = "serverURL[comment]"
125     { "value" = "Remote server URL (use FQDN)" } }
126   { "#comment" = "serverURL=https://xmlrpc.rhn.redhat.com/XMLRPC" }
127   { "6" = "serverURL"
128     { "value" = "https://enter.your.server.url.here/XMLRPC" } }
129   {  }
130   { "7" = "hostedWhitelist[comment]"
131     { "value" = "RHN Hosted URL's" } }
132   { "8" = "hostedWhitelist" }
133   {  }
134   { "9" = "enableProxy[comment]"
135     { "value" = "Use a HTTP Proxy" } }
136   { "10" = "enableProxy"
137     { "value" = "0" } }
138   {  }
139   { "11" = "versionOverride[comment]"
140     { "value" = "Override the automatically determined system version" } }
141   { "12" = "versionOverride" }
142   {  }
143   { "13" = "httpProxy[comment]"
144     { "value" = "HTTP proxy in host:port format, e.g. squid.redhat.com:3128" } }
145   { "14" = "httpProxy" }
146   {  }
147   { "15" = "noReboot[comment]"
148     { "value" = "Disable the reboot actions" } }
149   { "16" = "noReboot"
150     { "value" = "0" } }
151   {  }
152   { "17" = "networkRetries[comment]"
153     { "value" = "Number of attempts to make at network connections before giving up" } }
154   { "18" = "networkRetries"
155     { "value" = "1" } }
156   {  }
157   { "19" = "disallowConfChanges[comment]"
158     { "value" = "Config options that can not be overwritten by a config update action" } }
159   { "20" = "disallowConfChanges"
160     { "values"
161       { "1" = "noReboot" }
162       { "2" = "sslCACert" }
163       { "3" = "useNoSSLForPackages" }
164       { "4" = "noSSLServerURL" }
165       { "5" = "serverURL" }
166       { "6" = "disallowConfChanges" } } }
167   {  }
168   { "21" = "sslCACert[comment]"
169     { "value" = "The CA cert used to verify the ssl server" } }
170   { "22" = "sslCACert"
171     { "value" = "/usr/share/rhn/RHNS-CA-CERT" } }
172   {  }
173   { "#comment" = "Akamai does not support http protocol, therefore setting this option as side effect disable \"Location aware\" function" }
174   { "23" = "useNoSSLForPackages[comment]"
175     { "value" = "Use the noSSLServerURL for package, package list, and header fetching (disable Akamai)" } }
176   { "24" = "useNoSSLForPackages"
177     { "value" = "0" } }
178   {  }
179   { "25" = "retrieveOnly[comment]"
180     { "value" = "Retrieve packages only" } }
181   { "26" = "retrieveOnly"
182     { "value" = "0" } }
183   {  }
184   { "27" = "skipNetwork[comment]"
185     { "value" = "Skips network information in hardware profile sync during registration." } }
186   { "28" = "skipNetwork"
187     { "value" = "0" } }
188   {  }
189   { "29" = "tmpDir[comment]"
190     { "value" = "Use this Directory to place the temporary transport files" } }
191   { "30" = "tmpDir"
192     { "value" = "/tmp" } }
193   {  }
194   { "31" = "writeChangesToLog[comment]"
195     { "value" = "Log to /var/log/up2date which packages has been added and removed" } }
196   { "32" = "writeChangesToLog"
197     { "value" = "0" } }
198   {  }
199   { "33" = "stagingContent[comment]"
200     { "value" = "Retrieve content of future actions in advance" } }
201   { "34" = "stagingContent"
202     { "value" = "1" } }
203   {  }
204   { "35" = "stagingContentWindow[comment]"
205     { "value" = "How much forward we should look for future actions. In hours." } }
206   { "36" = "stagingContentWindow"
207     { "value" = "24" } }
208
209