blob: cfc062a7c5a8ed7851270c23f5b10a723b8fc5cd [file] [log] [blame]
Rahul Maheshwarie95622c2017-02-24 10:04:29 -06001*** Settings ***
2
3Documentation Test auto reboot functionality of host.
4
5Resource ../lib/openbmc_ffdc.robot
6Resource ../lib/rest_client.robot
7Resource ../lib/state_manager.robot
George Keishingeac2eb22017-10-03 05:24:17 -05008Resource ../lib/boot_utils.robot
Rahul Maheshwarie95622c2017-02-24 10:04:29 -06009
George Keishing19f76db2017-12-07 23:27:11 -060010Test Teardown Test Teardown Execution
11Suite Teardown Suite Teardown Execution
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060012
13*** Variables ***
14
15
16*** Test Cases ***
17
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060018Verify Host Quiesce State Without Auto Reboot During Boot
19 # Description of template fields:
Rahul Maheshwariffd30de2017-06-27 05:57:45 -050020 # Auto Reboot Initial Host State Expected Host Action
Sweta Potthuri62a23572017-07-28 04:05:13 -050021 ${0} Booting No Reboot
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060022 [Documentation] Validate "Quiesce" state during IPL.
23 [Tags] Verify_Host_Quiesce_State_Without_Auto_Reboot_During_Boot
24 [Template] Verify Host Quiesce State
25
George Keishing37cfa6b2017-06-15 10:25:55 -050026
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060027Verify Host Quiesce State With Auto Reboot During Boot
28 # Description of template fields:
Rahul Maheshwariffd30de2017-06-27 05:57:45 -050029 # Auto Reboot Initial Host State Expected Host Action
Sweta Potthuri62a23572017-07-28 04:05:13 -050030 ${1} Booting Reboot
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060031 [Documentation] Validate "Quiesce" state during IPL.
32 [Tags] Verify_Host_Quiesce_State_With_Auto_Reboot_During_Boot
33 [Template] Verify Host Quiesce State
34
35
36*** Keywords ***
37
38Verify Host Quiesce State
39 [Documentation] Inject watchdog error on host to reach "Quiesce" state.
40 ... Later recover host from this state.
Rahul Maheshwariffd30de2017-06-27 05:57:45 -050041 [Arguments] ${auto_reboot} ${initial_host_state} ${action}
42 # Description of argument(s):
Sweta Potthuri62a23572017-07-28 04:05:13 -050043 # auto_reboot Auto reboot setting
44 # i.e 1 for enabling and 0 for disabling.
Rahul Maheshwariffd30de2017-06-27 05:57:45 -050045 # initial_host_state State of host before injecting error.
46 # action Action of host due to error ("No Reboot" or
Sweta Potthurie0c02892017-07-31 00:43:40 -050047 # "Reboot").
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060048
49 Set Auto Reboot ${auto_reboot}
50
Rahul Maheshwariffd30de2017-06-27 05:57:45 -050051 Run Keyword If '${initial_host_state}' == 'Booting'
52 # Booting refers to host OS starting in progress.
53 ... Run Keywords Get Boot Progress To OS Starting State
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060054
55 Trigger Host Watchdog Error
56 ${resp}= Run Keyword And Return Status Is Host Rebooted
57
58 Run Keyword If '${action}' == 'No Reboot'
59 ... Run Keywords Should Be Equal ${resp} ${False} AND
60 ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND
61 ... Recover Quiesced Host
62 ... ELSE IF '${action}' == 'Reboot'
63 ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Rebooted
64
65
George Keishing19f76db2017-12-07 23:27:11 -060066Test Teardown Execution
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060067 [Documentation] Do the post test teardown.
68 ... 1. Capture FFDC on test failure.
69 ... 2. Set default value for auto reboot.
70 ... 3. Close all open SSH connections.
71
72 FFDC On Test Case Fail
Sweta Potthuri62a23572017-07-28 04:05:13 -050073 Set Auto Reboot ${1}
Rahul Maheshwarie95622c2017-02-24 10:04:29 -060074 Close All Connections
George Keishing19f76db2017-12-07 23:27:11 -060075
76Suite Teardown Execution
77 [Documentation] Do the suite test teardown.
78
79 ${status}= Is Host Quiesced
80 Run Keyword If ${status} == ${True} Smart Power Off