| 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 |  | 
| George Keishing | 19f76db | 2017-12-07 23:27:11 -0600 | [diff] [blame] | 10 | Test Teardown       Test Teardown Execution | 
|  | 11 | Suite Teardown      Suite Teardown Execution | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 12 |  | 
|  | 13 | *** Variables *** | 
|  | 14 |  | 
|  | 15 |  | 
|  | 16 | *** Test Cases *** | 
|  | 17 |  | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 18 | Verify Host Quiesce State Without Auto Reboot During Boot | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 19 | [Documentation]  Validate "Quiesce" state during IPL. | 
|  | 20 | [Tags]  Verify_Host_Quiesce_State_Without_Auto_Reboot_During_Boot | 
|  | 21 | [Template]  Verify Host Quiesce State | 
|  | 22 |  | 
| George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 23 | # Auto Reboot   Initial Host State     Expected Host Action | 
|  | 24 | ${0}               Booting                No Reboot | 
|  | 25 |  | 
| George Keishing | 37cfa6b | 2017-06-15 10:25:55 -0500 | [diff] [blame] | 26 |  | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 27 | Verify Host Quiesce State With Auto Reboot During Boot | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 28 | [Documentation]  Validate "Quiesce" state during IPL. | 
|  | 29 | [Tags]  Verify_Host_Quiesce_State_With_Auto_Reboot_During_Boot | 
|  | 30 | [Template]  Verify Host Quiesce State | 
|  | 31 |  | 
| George Keishing | 5abfe60 | 2018-07-05 11:54:37 -0500 | [diff] [blame] | 32 | # Auto Reboot   Initial Host State     Expected Host Action | 
|  | 33 | ${1}               Booting                Reboot | 
|  | 34 |  | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 35 |  | 
|  | 36 | *** Keywords *** | 
|  | 37 |  | 
|  | 38 | Verify Host Quiesce State | 
|  | 39 | [Documentation]  Inject watchdog error on host to reach "Quiesce" state. | 
|  | 40 | ...  Later recover host from this state. | 
| Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 41 | [Arguments]  ${auto_reboot}  ${initial_host_state}  ${action} | 
|  | 42 | # Description of argument(s): | 
| Sweta Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 43 | # auto_reboot          Auto reboot setting | 
|  | 44 | #                      i.e 1 for enabling and 0 for disabling. | 
| Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 45 | # initial_host_state   State of host before injecting error. | 
|  | 46 | # action               Action of host due to error ("No Reboot" or | 
| Sweta Potthuri | e0c0289 | 2017-07-31 00:43:40 -0500 | [diff] [blame] | 47 | #                      "Reboot"). | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 48 |  | 
|  | 49 | Set Auto Reboot  ${auto_reboot} | 
|  | 50 |  | 
| Rahul Maheshwari | ffd30de | 2017-06-27 05:57:45 -0500 | [diff] [blame] | 51 | 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 Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 54 |  | 
|  | 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 Keishing | 19f76db | 2017-12-07 23:27:11 -0600 | [diff] [blame] | 66 | Test Teardown Execution | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 67 | [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 Potthuri | 62a2357 | 2017-07-28 04:05:13 -0500 | [diff] [blame] | 73 | Set Auto Reboot  ${1} | 
| Rahul Maheshwari | e95622c | 2017-02-24 10:04:29 -0600 | [diff] [blame] | 74 | Close All Connections | 
| George Keishing | 19f76db | 2017-12-07 23:27:11 -0600 | [diff] [blame] | 75 |  | 
|  | 76 | Suite Teardown Execution | 
|  | 77 | [Documentation]  Do the suite test teardown. | 
|  | 78 |  | 
|  | 79 | ${status}=  Is Host Quiesced | 
|  | 80 | Run Keyword If  ${status} == ${True}  Smart Power Off |