1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
|
Created new pacemaker configuration
A new shadow instance was created. To begin using it, enter the following into your shell:
export CIB_shadow=cts-cli
=#=#=#= Begin test: crm_rule given no arguments =#=#=#=
crm_rule: No mode operation given
=#=#=#= End test: crm_rule given no arguments - Incorrect usage (64) =#=#=#=
* Passed: crm_rule - crm_rule given no arguments
=#=#=#= Begin test: crm_rule given no arguments (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule --output-as=xml">
<status code="64" message="Incorrect usage">
<errors>
<error>crm_rule: No mode operation given</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: crm_rule given no arguments (XML) - Incorrect usage (64) =#=#=#=
* Passed: crm_rule - crm_rule given no arguments (XML)
=#=#=#= Begin test: crm_rule given no rule to check =#=#=#=
crm_rule: --check requires use of --rule=
=#=#=#= End test: crm_rule given no rule to check - Incorrect usage (64) =#=#=#=
* Passed: crm_rule - crm_rule given no rule to check
=#=#=#= Begin test: crm_rule given no rule to check (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c --output-as=xml">
<status code="64" message="Incorrect usage">
<errors>
<error>crm_rule: --check requires use of --rule=</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: crm_rule given no rule to check (XML) - Incorrect usage (64) =#=#=#=
* Passed: crm_rule - crm_rule given no rule to check (XML)
=#=#=#= Begin test: crm_rule given invalid input XML =#=#=#=
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
crm_rule: Couldn't parse input string: invalidxml
=#=#=#= End test: crm_rule given invalid input XML - Invalid data given (65) =#=#=#=
* Passed: crm_rule - crm_rule given invalid input XML
=#=#=#= Begin test: crm_rule given invalid input XML (XML) =#=#=#=
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
<pacemaker-result api-version="X" request="crm_rule -c -r blahblah -X invalidxml --output-as=xml">
<status code="65" message="Invalid data given">
<errors>
<error>crm_rule: Couldn't parse input string: invalidxml
</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: crm_rule given invalid input XML (XML) - Invalid data given (65) =#=#=#=
* Passed: crm_rule - crm_rule given invalid input XML (XML)
=#=#=#= Begin test: crm_rule given invalid input XML on stdin =#=#=#=
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
crm_rule: Couldn't parse input from STDIN
=#=#=#= End test: crm_rule given invalid input XML on stdin - Invalid data given (65) =#=#=#=
* Passed: echo - crm_rule given invalid input XML on stdin
=#=#=#= Begin test: crm_rule given invalid input XML on stdin (XML) =#=#=#=
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
log_xmllib_err error: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
log_xmllib_err error: XML Error: invalidxml
log_xmllib_err error: XML Error: ^
<pacemaker-result api-version="X" request="crm_rule -c -r blahblah -X - --output-as=xml">
<status code="65" message="Invalid data given">
<errors>
<error>crm_rule: Couldn't parse input from STDIN
</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: crm_rule given invalid input XML on stdin (XML) - Invalid data given (65) =#=#=#=
* Passed: echo - crm_rule given invalid input XML on stdin (XML)
=#=#=#= Begin test: Try to check a rule that doesn't exist =#=#=#=
Could not determine whether rule blahblah is in effect: Rule not found
=#=#=#= Current cib after: Try to check a rule that doesn't exist =#=#=#=
<cib epoch="10" num_updates="0" admin_epoch="0">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
</cluster_property_set>
</crm_config>
<nodes/>
<resources>
<primitive class="ocf" id="dummy" provider="heartbeat" type="Dummy"/>
</resources>
<constraints>
<rsc_location id="cli-too-many-date-expressions" rsc="dummy">
<rule id="cli-rule-too-many-date-expressions" score="INFINITY" boolean-op="or">
<date_expression id="cli-date-expression-1" operation="gt" start=""/>
<date_expression id="cli-date-expression-2" operation="lt" end=""/>
</rule>
</rsc_location>
<rsc_location id="cli-prefer-dummy-expired" rsc="dummy">
<rule id="cli-prefer-rule-dummy-expired" score="INFINITY">
<date_expression id="cli-prefer-lifetime-end-dummy-expired" operation="lt" end=""/>
</rule>
</rsc_location>
<rsc_location id="cli-prefer-dummy-not-yet" rsc="dummy">
<rule id="cli-prefer-rule-dummy-not-yet" score="INFINITY">
<date_expression id="cli-prefer-lifetime-end-dummy-not-yet" operation="gt" start=""/>
</rule>
</rsc_location>
<rsc_location id="cli-prefer-dummy-date_spec-only-years" rsc="dummy">
<rule id="cli-prefer-rule-dummy-date_spec-only-years" score="INFINITY">
<date_expression id="cli-prefer-dummy-date_spec-only-years-expr" operation="date_spec">
<date_spec id="cli-prefer-dummy-date_spec-only-years-spec" years="2019"/>
</date_expression>
</rule>
</rsc_location>
<rsc_location id="cli-prefer-dummy-date_spec-without-years" rsc="dummy">
<rule id="cli-prefer-rule-dummy-date_spec-without-years" score="INFINITY">
<date_expression id="cli-prefer-dummy-date_spec-without-years-expr" operation="date_spec">
<date_spec id="cli-prefer-dummy-date_spec-without-years-spec" hours="20" months="1,3,5,7"/>
</date_expression>
</rule>
</rsc_location>
<rsc_location id="cli-prefer-dummy-date_spec-years-moon" rsc="dummy">
<rule id="cli-prefer-rule-dummy-date_spec-years-moon" score="INFINITY">
<date_expression id="cli-prefer-dummy-date_spec-years-moon-expr" operation="date_spec">
<date_spec id="cli-prefer-dummy-date_spec-years-moon-spec" years="2019" moon="1"/>
</date_expression>
</rule>
</rsc_location>
<rsc_location id="cli-no-date_expression" rsc="dummy">
<rule id="cli-no-date_expression-rule" score="INFINITY">
<expression id="ban-apache-expr" attribute="#uname" operation="eq" value="node3"/>
</rule>
</rsc_location>
</constraints>
</configuration>
<status/>
</cib>
=#=#=#= End test: Try to check a rule that doesn't exist - No such object (105) =#=#=#=
* Passed: crm_rule - Try to check a rule that doesn't exist
=#=#=#= Begin test: Try to check a rule that doesn't exist, with XML output =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r blahblah --output-as=xml">
<rule-check rule-id="blahblah" rc="105"/>
<status code="105" message="No such object">
<errors>
<error>Could not determine whether rule blahblah is in effect: Rule not found</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: Try to check a rule that doesn't exist, with XML output - No such object (105) =#=#=#=
* Passed: crm_rule - Try to check a rule that doesn't exist, with XML output
=#=#=#= Begin test: Try to check a rule that has too many date_expressions =#=#=#=
Could not determine whether rule cli-rule-too-many-date-expressions is in effect: Rule has more than one date expression
=#=#=#= End test: Try to check a rule that has too many date_expressions - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule that has too many date_expressions
=#=#=#= Begin test: Try to check a rule that has too many date_expressions (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-rule-too-many-date-expressions --output-as=xml">
<rule-check rule-id="cli-rule-too-many-date-expressions" rc="3"/>
<status code="3" message="Unimplemented">
<errors>
<error>Could not determine whether rule cli-rule-too-many-date-expressions is in effect: Rule has more than one date expression</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: Try to check a rule that has too many date_expressions (XML) - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule that has too many date_expressions (XML)
=#=#=#= Begin test: Verify basic rule is expired =#=#=#=
Rule cli-prefer-rule-dummy-expired is expired
=#=#=#= End test: Verify basic rule is expired - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify basic rule is expired
=#=#=#= Begin test: Verify basic rule is expired, with XML output =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-expired --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-expired" rc="110"/>
<status code="110" message="Requested item has expired"/>
</pacemaker-result>
=#=#=#= End test: Verify basic rule is expired, with XML output - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify basic rule is expired, with XML output
=#=#=#= Begin test: Verify basic rule worked in the past =#=#=#=
Rule cli-prefer-rule-dummy-expired is still in effect
=#=#=#= End test: Verify basic rule worked in the past - OK (0) =#=#=#=
* Passed: crm_rule - Verify basic rule worked in the past
=#=#=#= Begin test: Verify basic rule worked in the past (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-expired -d 20180101 --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-expired" rc="0"/>
<status code="0" message="OK"/>
</pacemaker-result>
=#=#=#= End test: Verify basic rule worked in the past (XML) - OK (0) =#=#=#=
* Passed: crm_rule - Verify basic rule worked in the past (XML)
=#=#=#= Begin test: Verify basic rule is not yet in effect =#=#=#=
Rule cli-prefer-rule-dummy-not-yet has not yet taken effect
=#=#=#= End test: Verify basic rule is not yet in effect - Requested item is not yet in effect (111) =#=#=#=
* Passed: crm_rule - Verify basic rule is not yet in effect
=#=#=#= Begin test: Verify basic rule is not yet in effect (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-not-yet --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-not-yet" rc="111"/>
<status code="111" message="Requested item is not yet in effect"/>
</pacemaker-result>
=#=#=#= End test: Verify basic rule is not yet in effect (XML) - Requested item is not yet in effect (111) =#=#=#=
* Passed: crm_rule - Verify basic rule is not yet in effect (XML)
=#=#=#= Begin test: Verify date_spec rule with years has expired =#=#=#=
Rule cli-prefer-rule-dummy-date_spec-only-years is expired
=#=#=#= End test: Verify date_spec rule with years has expired - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify date_spec rule with years has expired
=#=#=#= Begin test: Verify date_spec rule with years has expired (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-date_spec-only-years --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-date_spec-only-years" rc="110"/>
<status code="110" message="Requested item has expired"/>
</pacemaker-result>
=#=#=#= End test: Verify date_spec rule with years has expired (XML) - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify date_spec rule with years has expired (XML)
=#=#=#= Begin test: Verify multiple rules at once =#=#=#=
Rule cli-prefer-rule-dummy-not-yet has not yet taken effect
Rule cli-prefer-rule-dummy-date_spec-only-years is expired
=#=#=#= End test: Verify multiple rules at once - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify multiple rules at once
=#=#=#= Begin test: Verify multiple rules at once, with XML output =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-not-yet -r cli-prefer-rule-dummy-date_spec-only-years --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-not-yet" rc="111"/>
<rule-check rule-id="cli-prefer-rule-dummy-date_spec-only-years" rc="110"/>
<status code="110" message="Requested item has expired"/>
</pacemaker-result>
=#=#=#= End test: Verify multiple rules at once, with XML output - Requested item has expired (110) =#=#=#=
* Passed: crm_rule - Verify multiple rules at once, with XML output
=#=#=#= Begin test: Verify date_spec rule with years is in effect =#=#=#=
Rule cli-prefer-rule-dummy-date_spec-only-years satisfies conditions
=#=#=#= End test: Verify date_spec rule with years is in effect - OK (0) =#=#=#=
* Passed: crm_rule - Verify date_spec rule with years is in effect
=#=#=#= Begin test: Verify date_spec rule with years is in effect (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-date_spec-only-years -d 20190201 --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-date_spec-only-years" rc="0"/>
<status code="0" message="OK"/>
</pacemaker-result>
=#=#=#= End test: Verify date_spec rule with years is in effect (XML) - OK (0) =#=#=#=
* Passed: crm_rule - Verify date_spec rule with years is in effect (XML)
=#=#=#= Begin test: Try to check a rule whose date_spec does not contain years= =#=#=#=
Could not determine whether rule cli-prefer-rule-dummy-date_spec-without-years is in effect: Rule must either not use date_spec, or use date_spec with years= but not moon=
=#=#=#= End test: Try to check a rule whose date_spec does not contain years= - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule whose date_spec does not contain years=
=#=#=#= Begin test: Try to check a rule whose date_spec does not contain years= (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-date_spec-without-years --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-date_spec-without-years" rc="3"/>
<status code="3" message="Unimplemented">
<errors>
<error>Could not determine whether rule cli-prefer-rule-dummy-date_spec-without-years is in effect: Rule must either not use date_spec, or use date_spec with years= but not moon=</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: Try to check a rule whose date_spec does not contain years= (XML) - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule whose date_spec does not contain years= (XML)
=#=#=#= Begin test: Try to check a rule whose date_spec contains years= and moon= =#=#=#=
Could not determine whether rule cli-prefer-rule-dummy-date_spec-years-moon is in effect: Rule must either not use date_spec, or use date_spec with years= but not moon=
=#=#=#= End test: Try to check a rule whose date_spec contains years= and moon= - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule whose date_spec contains years= and moon=
=#=#=#= Begin test: Try to check a rule whose date_spec contains years= and moon= (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-prefer-rule-dummy-date_spec-years-moon --output-as=xml">
<rule-check rule-id="cli-prefer-rule-dummy-date_spec-years-moon" rc="3"/>
<status code="3" message="Unimplemented">
<errors>
<error>Could not determine whether rule cli-prefer-rule-dummy-date_spec-years-moon is in effect: Rule must either not use date_spec, or use date_spec with years= but not moon=</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: Try to check a rule whose date_spec contains years= and moon= (XML) - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule whose date_spec contains years= and moon= (XML)
=#=#=#= Begin test: Try to check a rule with no date_expression =#=#=#=
Could not determine whether rule cli-no-date_expression-rule is in effect: Rule does not have a date expression
=#=#=#= End test: Try to check a rule with no date_expression - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule with no date_expression
=#=#=#= Begin test: Try to check a rule with no date_expression (XML) =#=#=#=
<pacemaker-result api-version="X" request="crm_rule -c -r cli-no-date_expression-rule --output-as=xml">
<rule-check rule-id="cli-no-date_expression-rule" rc="3"/>
<status code="3" message="Unimplemented">
<errors>
<error>Could not determine whether rule cli-no-date_expression-rule is in effect: Rule does not have a date expression</error>
</errors>
</status>
</pacemaker-result>
=#=#=#= End test: Try to check a rule with no date_expression (XML) - Unimplemented (3) =#=#=#=
* Passed: crm_rule - Try to check a rule with no date_expression (XML)
|