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 |
George Keishing | eac2eb2 | 2017-10-03 05:24:17 -0500 | [diff] [blame] | 8 | Resource ../lib/boot_utils.robot |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 9 | |
| 10 | Test Setup Open Connection And Log In |
| 11 | Test Teardown Post Testcase Execution |
George Keishing | eac2eb2 | 2017-10-03 05:24:17 -0500 | [diff] [blame] | 12 | Suite Teardown Smart Power Off |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 13 | |
| 14 | *** Variables *** |
| 15 | |
| 16 | |
| 17 | *** Test Cases *** |
| 18 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 19 | Verify Host Quiesce State Without Auto Reboot During Boot |
| 20 | # Description of template fields: |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 21 | # Auto Reboot Initial Host State Expected Host Action |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 22 | ${0} Booting No Reboot |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 23 | [Documentation] Validate "Quiesce" state during IPL. |
| 24 | [Tags] Verify_Host_Quiesce_State_Without_Auto_Reboot_During_Boot |
| 25 | [Template] Verify Host Quiesce State |
| 26 | |
George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 27 | |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 28 | Verify Host Quiesce State With Auto Reboot During Boot |
| 29 | # Description of template fields: |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 30 | # Auto Reboot Initial Host State Expected Host Action |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 31 | ${1} Booting Reboot |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 32 | [Documentation] Validate "Quiesce" state during IPL. |
| 33 | [Tags] Verify_Host_Quiesce_State_With_Auto_Reboot_During_Boot |
| 34 | [Template] Verify Host Quiesce State |
| 35 | |
| 36 | |
| 37 | *** Keywords *** |
| 38 | |
| 39 | Verify Host Quiesce State |
| 40 | [Documentation] Inject watchdog error on host to reach "Quiesce" state. |
| 41 | ... Later recover host from this state. |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 42 | [Arguments] ${auto_reboot} ${initial_host_state} ${action} |
| 43 | # Description of argument(s): |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 44 | # auto_reboot Auto reboot setting |
| 45 | # i.e 1 for enabling and 0 for disabling. |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 46 | # initial_host_state State of host before injecting error. |
| 47 | # action Action of host due to error ("No Reboot" or |
Sweta Potthuri | e0c0289 | 2017-07-31 00:43:40 -0500 | [diff] [blame] | 48 | # "Reboot"). |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 49 | |
| 50 | Set Auto Reboot ${auto_reboot} |
| 51 | |
Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 52 | Run Keyword If '${initial_host_state}' == 'Booting' |
| 53 | # Booting refers to host OS starting in progress. |
| 54 | ... Run Keywords Get Boot Progress To OS Starting State |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 55 | |
| 56 | Trigger Host Watchdog Error |
| 57 | ${resp}= Run Keyword And Return Status Is Host Rebooted |
| 58 | |
| 59 | Run Keyword If '${action}' == 'No Reboot' |
| 60 | ... Run Keywords Should Be Equal ${resp} ${False} AND |
| 61 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Quiesced AND |
| 62 | ... Recover Quiesced Host |
| 63 | ... ELSE IF '${action}' == 'Reboot' |
| 64 | ... Wait Until Keyword Succeeds 3 min 5 sec Is Host Rebooted |
| 65 | |
| 66 | |
| 67 | Post Testcase Execution |
| 68 | [Documentation] Do the post test teardown. |
| 69 | ... 1. Capture FFDC on test failure. |
| 70 | ... 2. Set default value for auto reboot. |
| 71 | ... 3. Close all open SSH connections. |
| 72 | |
| 73 | FFDC On Test Case Fail |
Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 74 | Set Auto Reboot ${1} |
Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 75 | Close All Connections |