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: |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 19 | # Auto Reboot Initial Host State Expected Host Action |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 20 | ${0} Booting No Reboot |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 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: |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 28 | # Auto Reboot Initial Host State Expected Host Action |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 29 | ${1} Booting Reboot |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 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. |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 40 | [Arguments] ${auto_reboot} ${initial_host_state} ${action} |
| 41 | # Description of argument(s): |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 42 | # auto_reboot Auto reboot setting |
| 43 | # i.e 1 for enabling and 0 for disabling. |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 44 | # initial_host_state State of host before injecting error. |
| 45 | # action Action of host due to error ("No Reboot" or |
Sweta Potthuri | e0c0289 | 2017-07-31 00:43:40 -0500 | [diff] [blame] | 46 | # "Reboot"). |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 47 | |
| 48 | Set Auto Reboot ${auto_reboot} |
| 49 | |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 50 | Run Keyword If '${initial_host_state}' == 'Booting' |
| 51 | # Booting refers to host OS starting in progress. |
| 52 | ... Run Keywords Get Boot Progress To OS Starting State |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 53 | |
| 54 | Trigger Host Watchdog Error |
| 55 | ${resp}= Run Keyword And Return Status Is Host Rebooted |
| 56 | |
| 57 | Run Keyword If '${action}' == 'No Reboot' |
| 58 | ... Run Keywords Should Be Equal ${resp} ${False} AND |
| 59 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND |
| 60 | ... Recover Quiesced Host |
| 61 | ... ELSE IF '${action}' == 'Reboot' |
| 62 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Rebooted |
| 63 | |
| 64 | |
| 65 | Post Testcase Execution |
| 66 | [Documentation] Do the post test teardown. |
| 67 | ... 1. Capture FFDC on test failure. |
| 68 | ... 2. Set default value for auto reboot. |
| 69 | ... 3. Close all open SSH connections. |
| 70 | |
| 71 | FFDC On Test Case Fail |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 72 | Set Auto Reboot ${1} |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 73 | Close All Connections |