1*** Settings ***
2Documentation  This module provides one wrapper keyword for each kind of boot
3...            test supported by obmc_boot_test.py.
4
5Resource  ../extended/obmc_boot_test_resource.robot
6
7*** Keywords ***
8REST Power On
9    [Documentation]  Do "REST Power On" boot test.
10    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
11
12    # Description of argument(s):
13    # stack_mode                    If stack_mode is set to "skip", each test
14    #                               specified in the boot_stack is only
15    #                               performed if the machine is not already in
16    #                               the state that would normally result from
17    #                               running the given boot test.  Otherwise,
18    #                               the test is skipped.  If stack_mode is set
19    #                               to "normal", all tests from the boot_stack
20    #                               are performed.  "skip" mode is useful when
21    #                               you simply want the machine in a desired
22    #                               state.  The default value is the global
23    #                               value of "${stack_mode}"
24    # quiet                         If this parameter is set to ${1}, this
25    #                               keyword will print only essential
26    #                               information.  The default value is the
27    #                               global value of "${quiet}"
28
29    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=REST Power On
30    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
31    Run Key U  ${cmd_buf}
32
33
34IPMI Power On
35    [Documentation]  Do "IPMI Power On" boot test.
36    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
37
38    # Description of argument(s):
39    # stack_mode                    If stack_mode is set to "skip", each test
40    #                               specified in the boot_stack is only
41    #                               performed if the machine is not already in
42    #                               the state that would normally result from
43    #                               running the given boot test.  Otherwise,
44    #                               the test is skipped.  If stack_mode is set
45    #                               to "normal", all tests from the boot_stack
46    #                               are performed.  "skip" mode is useful when
47    #                               you simply want the machine in a desired
48    #                               state.  The default value is the global
49    #                               value of "${stack_mode}"
50    # quiet                         If this parameter is set to ${1}, this
51    #                               keyword will print only essential
52    #                               information.  The default value is the
53    #                               global value of "${quiet}"
54
55    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=IPMI Power On
56    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
57    Run Key U  ${cmd_buf}
58
59
60REST Power Off
61    [Documentation]  Do "REST Power Off" boot test.
62    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
63
64    # Description of argument(s):
65    # stack_mode                    If stack_mode is set to "skip", each test
66    #                               specified in the boot_stack is only
67    #                               performed if the machine is not already in
68    #                               the state that would normally result from
69    #                               running the given boot test.  Otherwise,
70    #                               the test is skipped.  If stack_mode is set
71    #                               to "normal", all tests from the boot_stack
72    #                               are performed.  "skip" mode is useful when
73    #                               you simply want the machine in a desired
74    #                               state.  The default value is the global
75    #                               value of "${stack_mode}"
76    # quiet                         If this parameter is set to ${1}, this
77    #                               keyword will print only essential
78    #                               information.  The default value is the
79    #                               global value of "${quiet}"
80
81    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=REST Power Off
82    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
83    Run Key U  ${cmd_buf}
84
85
86REST Hard Power Off
87    [Documentation]  Do "REST Hard Power Off" boot test.
88    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
89
90    # Description of argument(s):
91    # stack_mode                    If stack_mode is set to "skip", each test
92    #                               specified in the boot_stack is only
93    #                               performed if the machine is not already in
94    #                               the state that would normally result from
95    #                               running the given boot test.  Otherwise,
96    #                               the test is skipped.  If stack_mode is set
97    #                               to "normal", all tests from the boot_stack
98    #                               are performed.  "skip" mode is useful when
99    #                               you simply want the machine in a desired
100    #                               state.  The default value is the global
101    #                               value of "${stack_mode}"
102    # quiet                         If this parameter is set to ${1}, this
103    #                               keyword will print only essential
104    #                               information.  The default value is the
105    #                               global value of "${quiet}"
106
107    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=REST Hard Power Off
108    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
109    Run Key U  ${cmd_buf}
110
111
112IPMI Power Off
113    [Documentation]  Do "IPMI Power Off" boot test.
114    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
115
116    # Description of argument(s):
117    # stack_mode                    If stack_mode is set to "skip", each test
118    #                               specified in the boot_stack is only
119    #                               performed if the machine is not already in
120    #                               the state that would normally result from
121    #                               running the given boot test.  Otherwise,
122    #                               the test is skipped.  If stack_mode is set
123    #                               to "normal", all tests from the boot_stack
124    #                               are performed.  "skip" mode is useful when
125    #                               you simply want the machine in a desired
126    #                               state.  The default value is the global
127    #                               value of "${stack_mode}"
128    # quiet                         If this parameter is set to ${1}, this
129    #                               keyword will print only essential
130    #                               information.  The default value is the
131    #                               global value of "${quiet}"
132
133    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=IPMI Power Off
134    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
135    Run Key U  ${cmd_buf}
136
137
138IPMI Power Soft
139    [Documentation]  Do "IPMI Power Soft" boot test.
140    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
141
142    # Description of argument(s):
143    # stack_mode                    If stack_mode is set to "skip", each test
144    #                               specified in the boot_stack is only
145    #                               performed if the machine is not already in
146    #                               the state that would normally result from
147    #                               running the given boot test.  Otherwise,
148    #                               the test is skipped.  If stack_mode is set
149    #                               to "normal", all tests from the boot_stack
150    #                               are performed.  "skip" mode is useful when
151    #                               you simply want the machine in a desired
152    #                               state.  The default value is the global
153    #                               value of "${stack_mode}"
154    # quiet                         If this parameter is set to ${1}, this
155    #                               keyword will print only essential
156    #                               information.  The default value is the
157    #                               global value of "${quiet}"
158
159    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=IPMI Power Soft
160    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
161    Run Key U  ${cmd_buf}
162
163
164Host Power Off
165    [Documentation]  Do "Host Power Off" boot test.
166    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
167
168    # Description of argument(s):
169    # stack_mode                    If stack_mode is set to "skip", each test
170    #                               specified in the boot_stack is only
171    #                               performed if the machine is not already in
172    #                               the state that would normally result from
173    #                               running the given boot test.  Otherwise,
174    #                               the test is skipped.  If stack_mode is set
175    #                               to "normal", all tests from the boot_stack
176    #                               are performed.  "skip" mode is useful when
177    #                               you simply want the machine in a desired
178    #                               state.  The default value is the global
179    #                               value of "${stack_mode}"
180    # quiet                         If this parameter is set to ${1}, this
181    #                               keyword will print only essential
182    #                               information.  The default value is the
183    #                               global value of "${quiet}"
184
185    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Host Power Off
186    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
187    Run Key U  ${cmd_buf}
188
189
190APOR
191    [Documentation]  Do "APOR" boot test.
192    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
193
194    # Description of argument(s):
195    # stack_mode                    If stack_mode is set to "skip", each test
196    #                               specified in the boot_stack is only
197    #                               performed if the machine is not already in
198    #                               the state that would normally result from
199    #                               running the given boot test.  Otherwise,
200    #                               the test is skipped.  If stack_mode is set
201    #                               to "normal", all tests from the boot_stack
202    #                               are performed.  "skip" mode is useful when
203    #                               you simply want the machine in a desired
204    #                               state.  The default value is the global
205    #                               value of "${stack_mode}"
206    # quiet                         If this parameter is set to ${1}, this
207    #                               keyword will print only essential
208    #                               information.  The default value is the
209    #                               global value of "${quiet}"
210
211    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=APOR
212    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
213    Run Key U  ${cmd_buf}
214
215
216OBMC Reboot (run)
217    [Documentation]  Do "OBMC Reboot (run)" boot test.
218    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
219
220    # Description of argument(s):
221    # stack_mode                    If stack_mode is set to "skip", each test
222    #                               specified in the boot_stack is only
223    #                               performed if the machine is not already in
224    #                               the state that would normally result from
225    #                               running the given boot test.  Otherwise,
226    #                               the test is skipped.  If stack_mode is set
227    #                               to "normal", all tests from the boot_stack
228    #                               are performed.  "skip" mode is useful when
229    #                               you simply want the machine in a desired
230    #                               state.  The default value is the global
231    #                               value of "${stack_mode}"
232    # quiet                         If this parameter is set to ${1}, this
233    #                               keyword will print only essential
234    #                               information.  The default value is the
235    #                               global value of "${quiet}"
236
237    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=OBMC Reboot (run)
238    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
239    Run Key U  ${cmd_buf}
240
241
242REST OBMC Reboot (run)
243    [Documentation]  Do "REST OBMC Reboot (run)" boot test.
244    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
245
246    # Description of argument(s):
247    # stack_mode                    If stack_mode is set to "skip", each test
248    #                               specified in the boot_stack is only
249    #                               performed if the machine is not already in
250    #                               the state that would normally result from
251    #                               running the given boot test.  Otherwise,
252    #                               the test is skipped.  If stack_mode is set
253    #                               to "normal", all tests from the boot_stack
254    #                               are performed.  "skip" mode is useful when
255    #                               you simply want the machine in a desired
256    #                               state.  The default value is the global
257    #                               value of "${stack_mode}"
258    # quiet                         If this parameter is set to ${1}, this
259    #                               keyword will print only essential
260    #                               information.  The default value is the
261    #                               global value of "${quiet}"
262
263    ${cmd_buf}  Catenate  OBMC Boot Test
264    ...  \ loc_boot_stack=REST OBMC Reboot (run)
265    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
266    Run Key U  ${cmd_buf}
267
268
269OBMC Reboot (off)
270    [Documentation]  Do "OBMC Reboot (off)" boot test.
271    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
272
273    # Description of argument(s):
274    # stack_mode                    If stack_mode is set to "skip", each test
275    #                               specified in the boot_stack is only
276    #                               performed if the machine is not already in
277    #                               the state that would normally result from
278    #                               running the given boot test.  Otherwise,
279    #                               the test is skipped.  If stack_mode is set
280    #                               to "normal", all tests from the boot_stack
281    #                               are performed.  "skip" mode is useful when
282    #                               you simply want the machine in a desired
283    #                               state.  The default value is the global
284    #                               value of "${stack_mode}"
285    # quiet                         If this parameter is set to ${1}, this
286    #                               keyword will print only essential
287    #                               information.  The default value is the
288    #                               global value of "${quiet}"
289
290    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=OBMC Reboot (off)
291    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
292    Run Key U  ${cmd_buf}
293
294
295REST OBMC Reboot (off)
296    [Documentation]  Do "REST OBMC Reboot (off)" boot test.
297    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
298
299    # Description of argument(s):
300    # stack_mode                    If stack_mode is set to "skip", each test
301    #                               specified in the boot_stack is only
302    #                               performed if the machine is not already in
303    #                               the state that would normally result from
304    #                               running the given boot test.  Otherwise,
305    #                               the test is skipped.  If stack_mode is set
306    #                               to "normal", all tests from the boot_stack
307    #                               are performed.  "skip" mode is useful when
308    #                               you simply want the machine in a desired
309    #                               state.  The default value is the global
310    #                               value of "${stack_mode}"
311    # quiet                         If this parameter is set to ${1}, this
312    #                               keyword will print only essential
313    #                               information.  The default value is the
314    #                               global value of "${quiet}"
315
316    ${cmd_buf}  Catenate  OBMC Boot Test
317    ...  \ loc_boot_stack=REST OBMC Reboot (off)
318    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
319    Run Key U  ${cmd_buf}
320
321
322PDU AC Cycle (run)
323    [Documentation]  Do "PDU AC Cycle (run)" boot test.
324    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
325
326    # Description of argument(s):
327    # stack_mode                    If stack_mode is set to "skip", each test
328    #                               specified in the boot_stack is only
329    #                               performed if the machine is not already in
330    #                               the state that would normally result from
331    #                               running the given boot test.  Otherwise,
332    #                               the test is skipped.  If stack_mode is set
333    #                               to "normal", all tests from the boot_stack
334    #                               are performed.  "skip" mode is useful when
335    #                               you simply want the machine in a desired
336    #                               state.  The default value is the global
337    #                               value of "${stack_mode}"
338    # quiet                         If this parameter is set to ${1}, this
339    #                               keyword will print only essential
340    #                               information.  The default value is the
341    #                               global value of "${quiet}"
342
343    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=PDU AC Cycle (run)
344    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
345    Run Key U  ${cmd_buf}
346
347
348PDU AC Cycle (off)
349    [Documentation]  Do "PDU AC Cycle (off)" boot test.
350    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
351
352    # Description of argument(s):
353    # stack_mode                    If stack_mode is set to "skip", each test
354    #                               specified in the boot_stack is only
355    #                               performed if the machine is not already in
356    #                               the state that would normally result from
357    #                               running the given boot test.  Otherwise,
358    #                               the test is skipped.  If stack_mode is set
359    #                               to "normal", all tests from the boot_stack
360    #                               are performed.  "skip" mode is useful when
361    #                               you simply want the machine in a desired
362    #                               state.  The default value is the global
363    #                               value of "${stack_mode}"
364    # quiet                         If this parameter is set to ${1}, this
365    #                               keyword will print only essential
366    #                               information.  The default value is the
367    #                               global value of "${quiet}"
368
369    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=PDU AC Cycle (off)
370    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
371    Run Key U  ${cmd_buf}
372
373
374IPMI MC Reset Warm (run)
375    [Documentation]  Do "IPMI MC Reset Warm (run)" boot test.
376    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
377
378    # Description of argument(s):
379    # stack_mode                    If stack_mode is set to "skip", each test
380    #                               specified in the boot_stack is only
381    #                               performed if the machine is not already in
382    #                               the state that would normally result from
383    #                               running the given boot test.  Otherwise,
384    #                               the test is skipped.  If stack_mode is set
385    #                               to "normal", all tests from the boot_stack
386    #                               are performed.  "skip" mode is useful when
387    #                               you simply want the machine in a desired
388    #                               state.  The default value is the global
389    #                               value of "${stack_mode}"
390    # quiet                         If this parameter is set to ${1}, this
391    #                               keyword will print only essential
392    #                               information.  The default value is the
393    #                               global value of "${quiet}"
394
395    ${cmd_buf}  Catenate  OBMC Boot Test
396    ...  \ loc_boot_stack=IPMI MC Reset Warm (run)
397    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
398    Run Key U  ${cmd_buf}
399
400
401IPMI MC Reset Warm (off)
402    [Documentation]  Do "IPMI MC Reset Warm (off)" boot test.
403    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
404
405    # Description of argument(s):
406    # stack_mode                    If stack_mode is set to "skip", each test
407    #                               specified in the boot_stack is only
408    #                               performed if the machine is not already in
409    #                               the state that would normally result from
410    #                               running the given boot test.  Otherwise,
411    #                               the test is skipped.  If stack_mode is set
412    #                               to "normal", all tests from the boot_stack
413    #                               are performed.  "skip" mode is useful when
414    #                               you simply want the machine in a desired
415    #                               state.  The default value is the global
416    #                               value of "${stack_mode}"
417    # quiet                         If this parameter is set to ${1}, this
418    #                               keyword will print only essential
419    #                               information.  The default value is the
420    #                               global value of "${quiet}"
421
422    ${cmd_buf}  Catenate  OBMC Boot Test
423    ...  \ loc_boot_stack=IPMI MC Reset Warm (off)
424    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
425    Run Key U  ${cmd_buf}
426
427
428IPMI Power Cycle
429    [Documentation]  Do "IPMI Power Cycle" boot test.
430    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
431
432    # Description of argument(s):
433    # stack_mode                    If stack_mode is set to "skip", each test
434    #                               specified in the boot_stack is only
435    #                               performed if the machine is not already in
436    #                               the state that would normally result from
437    #                               running the given boot test.  Otherwise,
438    #                               the test is skipped.  If stack_mode is set
439    #                               to "normal", all tests from the boot_stack
440    #                               are performed.  "skip" mode is useful when
441    #                               you simply want the machine in a desired
442    #                               state.  The default value is the global
443    #                               value of "${stack_mode}"
444    # quiet                         If this parameter is set to ${1}, this
445    #                               keyword will print only essential
446    #                               information.  The default value is the
447    #                               global value of "${quiet}"
448
449    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=IPMI Power Cycle
450    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
451    Run Key U  ${cmd_buf}
452
453
454IPMI Power Reset
455    [Documentation]  Do "IPMI Power Reset" boot test.
456    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
457
458    # Description of argument(s):
459    # stack_mode                    If stack_mode is set to "skip", each test
460    #                               specified in the boot_stack is only
461    #                               performed if the machine is not already in
462    #                               the state that would normally result from
463    #                               running the given boot test.  Otherwise,
464    #                               the test is skipped.  If stack_mode is set
465    #                               to "normal", all tests from the boot_stack
466    #                               are performed.  "skip" mode is useful when
467    #                               you simply want the machine in a desired
468    #                               state.  The default value is the global
469    #                               value of "${stack_mode}"
470    # quiet                         If this parameter is set to ${1}, this
471    #                               keyword will print only essential
472    #                               information.  The default value is the
473    #                               global value of "${quiet}"
474
475    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=IPMI Power Reset
476    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
477    Run Key U  ${cmd_buf}
478
479
480Auto Reboot
481    [Documentation]  Do "Auto Reboot" boot test.
482    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
483
484    # Description of argument(s):
485    # stack_mode                    If stack_mode is set to "skip", each test
486    #                               specified in the boot_stack is only
487    #                               performed if the machine is not already in
488    #                               the state that would normally result from
489    #                               running the given boot test.  Otherwise,
490    #                               the test is skipped.  If stack_mode is set
491    #                               to "normal", all tests from the boot_stack
492    #                               are performed.  "skip" mode is useful when
493    #                               you simply want the machine in a desired
494    #                               state.  The default value is the global
495    #                               value of "${stack_mode}"
496    # quiet                         If this parameter is set to ${1}, this
497    #                               keyword will print only essential
498    #                               information.  The default value is the
499    #                               global value of "${quiet}"
500
501    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Auto Reboot
502    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
503    Run Key U  ${cmd_buf}
504
505
506Host Reboot
507    [Documentation]  Do "Host Reboot" boot test.
508    [Arguments]  ${stack_mode}=${stack_mode}  ${quiet}=${quiet}
509
510    # Description of argument(s):
511    # stack_mode                    If stack_mode is set to "skip", each test
512    #                               specified in the boot_stack is only
513    #                               performed if the machine is not already in
514    #                               the state that would normally result from
515    #                               running the given boot test.  Otherwise,
516    #                               the test is skipped.  If stack_mode is set
517    #                               to "normal", all tests from the boot_stack
518    #                               are performed.  "skip" mode is useful when
519    #                               you simply want the machine in a desired
520    #                               state.  The default value is the global
521    #                               value of "${stack_mode}"
522    # quiet                         If this parameter is set to ${1}, this
523    #                               keyword will print only essential
524    #                               information.  The default value is the
525    #                               global value of "${quiet}"
526
527    ${cmd_buf}  Catenate  OBMC Boot Test \ loc_boot_stack=Host Reboot
528    ...  \ loc_stack_mode=${stack_mode} \ loc_quiet=${quiet}
529    Run Key U  ${cmd_buf}
530
531
532Smart Power Off
533    [Documentation]  Do a smart power off.
534    [Arguments]  ${quiet}=${QUIET}
535
536    # A 'Smart Power Off' consists of a 'REST Power Off' with recovery.
537    # Namely, if the 'REST Power Off' fails, a 'REST Hard Power Off' will
538    # be attempted.
539
540    # Description of argument(s):
541    # quiet                         If this parameter is set to ${1}, this
542    #                               keyword will print only essential
543    #                               information.  The default value is the
544    #                               global value of "${quiet}"
545
546
547    # OBMC Boot Test will restore global quiet to initial global value.
548    # Unfortunately, that restore affects our local quiet so we must
549    # preserve it.
550    ${loc_quiet}=  Set Variable  ${quiet}
551    ${cmd_buf}=  Catenate  REST Power Off \ stack_mode=skip
552    ...  \ \ quiet=${loc_quiet}
553    ${status}  ${ret_values}=  Run Key U  ${cmd_buf}  ignore=${1}
554    ...  quiet=${loc_quiet}
555
556    Run Keyword If  '${status}' == 'PASS'  Return From Keyword
557
558    ${cmd_buf}=  Catenate  REST Hard Power Off \ stack_mode=skip
559    ...  \ \ quiet=${loc_quiet}
560    Run Key U  ${cmd_buf}  quiet=${loc_quiet}
561
562