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 | |
| 17 | Verify Host Quiesce State Without Auto Reboot |
| 18 | # Description of template fields: |
| 19 | # Auto Reboot Host State Expected Host Action |
| 20 | no Off No Reboot |
| 21 | [Documentation] Validate "Quiesce" state without auto reboot. |
| 22 | [Tags] Verify_Host_Quiesce_State_Without_Auto_Reboot |
| 23 | [Template] Verify Host Quiesce State |
| 24 | |
| 25 | Verify Host Quiesce State With Auto Reboot |
| 26 | # Description of template fields: |
| 27 | # Auto Reboot Host State Expected Host Action |
| 28 | yes Off Reboot |
| 29 | [Documentation] Validate "Quiesce" state with auto reboot. |
| 30 | [Tags] Verify_Host_Quiesce_State_With_Auto_Reboot |
| 31 | [Template] Verify Host Quiesce State |
| 32 | |
| 33 | Verify Host Quiesce State Without Auto Reboot During Boot |
| 34 | # Description of template fields: |
| 35 | # Auto Reboot Host State Expected Host Action |
| 36 | no Booting No Reboot |
| 37 | [Documentation] Validate "Quiesce" state during IPL. |
| 38 | [Tags] Verify_Host_Quiesce_State_Without_Auto_Reboot_During_Boot |
| 39 | [Template] Verify Host Quiesce State |
| 40 | |
| 41 | Verify Host Quiesce State With Auto Reboot During Boot |
| 42 | # Description of template fields: |
| 43 | # Auto Reboot Host State Expected Host Action |
| 44 | yes Booting Reboot |
| 45 | [Documentation] Validate "Quiesce" state during IPL. |
| 46 | [Tags] Verify_Host_Quiesce_State_With_Auto_Reboot_During_Boot |
| 47 | [Template] Verify Host Quiesce State |
| 48 | |
| 49 | |
| 50 | *** Keywords *** |
| 51 | |
| 52 | Verify Host Quiesce State |
| 53 | [Documentation] Inject watchdog error on host to reach "Quiesce" state. |
| 54 | ... Later recover host from this state. |
| 55 | [Arguments] ${auto_reboot} ${host_state} ${action} |
| 56 | # Description of Arguments: |
| 57 | # auto_reboot Auto reboot setting ("yes" or "no"). |
| 58 | # host_state State of host before injecting error. |
| 59 | # action Action of host due to error ("No Reboot" or "Reboot"). |
| 60 | |
| 61 | Set Auto Reboot ${auto_reboot} |
| 62 | |
| 63 | Run Keyword If '${host_state}' == 'Off' Initiate Host PowerOff |
| 64 | ... ELSE IF '${host_state}' == 'Booting' |
| 65 | ... Run Keywords Initiate Host PowerOff AND Initiate Host Boot |
| 66 | |
| 67 | Trigger Host Watchdog Error |
| 68 | ${resp}= Run Keyword And Return Status Is Host Rebooted |
| 69 | |
| 70 | Run Keyword If '${action}' == 'No Reboot' |
| 71 | ... Run Keywords Should Be Equal ${resp} ${False} AND |
| 72 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND |
| 73 | ... Recover Quiesced Host |
| 74 | ... ELSE IF '${action}' == 'Reboot' |
| 75 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Rebooted |
| 76 | |
| 77 | |
| 78 | Post Testcase Execution |
| 79 | [Documentation] Do the post test teardown. |
| 80 | ... 1. Capture FFDC on test failure. |
| 81 | ... 2. Set default value for auto reboot. |
| 82 | ... 3. Close all open SSH connections. |
| 83 | |
| 84 | FFDC On Test Case Fail |
| 85 | Set Auto Reboot yes |
| 86 | Close All Connections |