Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Test auto reboot functionality of host. |
| 4 | |
| 5 | Resource ../lib/openbmc_ffdc.robot |
| 6 | Resource ../lib/rest_client.robot |
| 7 | Resource ../lib/state_manager.robot |
| 8 | |
| 9 | Test Setup Open Connection And Log In |
| 10 | Test Teardown Post Testcase Execution |
| 11 | |
| 12 | *** Variables *** |
| 13 | |
| 14 | |
| 15 | *** Test Cases *** |
| 16 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 17 | Verify Host Quiesce State Without Auto Reboot During Boot |
| 18 | # Description of template fields: |
| 19 | # Auto Reboot Host State Expected Host Action |
| 20 | no Booting No Reboot |
| 21 | [Documentation] Validate "Quiesce" state during IPL. |
| 22 | [Tags] Verify_Host_Quiesce_State_Without_Auto_Reboot_During_Boot |
| 23 | [Template] Verify Host Quiesce State |
| 24 | |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 25 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 26 | Verify Host Quiesce State With Auto Reboot During Boot |
| 27 | # Description of template fields: |
| 28 | # Auto Reboot Host State Expected Host Action |
| 29 | yes Booting Reboot |
| 30 | [Documentation] Validate "Quiesce" state during IPL. |
| 31 | [Tags] Verify_Host_Quiesce_State_With_Auto_Reboot_During_Boot |
| 32 | [Template] Verify Host Quiesce State |
| 33 | |
| 34 | |
| 35 | *** Keywords *** |
| 36 | |
| 37 | Verify Host Quiesce State |
| 38 | [Documentation] Inject watchdog error on host to reach "Quiesce" state. |
| 39 | ... Later recover host from this state. |
| 40 | [Arguments] ${auto_reboot} ${host_state} ${action} |
| 41 | # Description of Arguments: |
| 42 | # auto_reboot Auto reboot setting ("yes" or "no"). |
| 43 | # host_state State of host before injecting error. |
| 44 | # action Action of host due to error ("No Reboot" or "Reboot"). |
| 45 | |
| 46 | Set Auto Reboot ${auto_reboot} |
| 47 | |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 48 | Run Keyword If '${host_state}' == 'Off' Initiate Host PowerOn |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 49 | ... ELSE IF '${host_state}' == 'Booting' |
| 50 | ... Run Keywords Initiate Host PowerOff AND Initiate Host Boot |
| 51 | |
| 52 | Trigger Host Watchdog Error |
| 53 | ${resp}= Run Keyword And Return Status Is Host Rebooted |
| 54 | |
| 55 | Run Keyword If '${action}' == 'No Reboot' |
| 56 | ... Run Keywords Should Be Equal ${resp} ${False} AND |
| 57 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND |
| 58 | ... Recover Quiesced Host |
| 59 | ... ELSE IF '${action}' == 'Reboot' |
| 60 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Rebooted |
| 61 | |
| 62 | |
| 63 | Post Testcase Execution |
| 64 | [Documentation] Do the post test teardown. |
| 65 | ... 1. Capture FFDC on test failure. |
| 66 | ... 2. Set default value for auto reboot. |
| 67 | ... 3. Close all open SSH connections. |
| 68 | |
| 69 | FFDC On Test Case Fail |
| 70 | Set Auto Reboot yes |
| 71 | Close All Connections |