Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 2 | Documentation Test MPIPL (Memory preserving IPL). |
| 3 | |
| 4 | #------------------------------------------------------------------ |
| 5 | # This boot path will generated a BMC dump followed by system dump. |
| 6 | #------------------------------------------------------------------ |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 7 | |
George Keishing | d6ec836 | 2021-05-27 14:25:06 -0500 | [diff] [blame] | 8 | Resource ../../lib/resource.robot |
| 9 | Resource ../../lib/openbmc_ffdc.robot |
| 10 | Resource ../../lib/bmc_redfish_utils.robot |
| 11 | Resource ../../lib/bmc_redfish_resource.robot |
| 12 | Resource ../../lib/boot_utils.robot |
| 13 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 14 | Suite Setup Redfish.Login |
George Keishing | 6e72928 | 2022-08-10 22:44:07 -0500 | [diff] [blame] | 15 | Test Setup Test Setup Execution |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 16 | Test Teardown Test Teardown Execution |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 17 | Suite Teardown Suite Teardown Execution |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 18 | |
| 19 | *** Variables *** |
| 20 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 21 | # By default 1 iteration, user can key in nth number of iteration to control |
| 22 | # how many time it needs MPIPL test runs. |
| 23 | ${MPIPL_LOOP_COUNT} ${1} |
| 24 | |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 25 | |
| 26 | ** Test Cases ** |
| 27 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 28 | Trigger User Tool Initiated MPIPL |
| 29 | [Documentation] Trigger And Verify user tool initiated dump using |
| 30 | ... obmc-host-crash target. |
| 31 | [Tags] Trigger_User_Tool_Initiated_MPIPL |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 32 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 33 | FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT} |
| 34 | Log To Console MPIPL LOOP_COUNT:${count} execution. |
| 35 | Tool Initd MP Reboot |
George Keishing | 5e00979 | 2023-08-17 21:31:12 +0530 | [diff] [blame] | 36 | Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 37 | END |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 38 | |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 39 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 40 | Trigger User Initiated MPIPL Using Redfish |
| 41 | [Documentation] Verify redfish triggered MPIPL flow using diagnostic |
| 42 | ... mode target. |
| 43 | [Tags] Trigger_User_Initiated_MPIPL_Using_Redfish |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 44 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 45 | FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT} |
| 46 | Log To Console MPIPL LOOP_COUNT:${count} execution. |
| 47 | Redfish Initiated MPIPL |
George Keishing | 5e00979 | 2023-08-17 21:31:12 +0530 | [diff] [blame] | 48 | Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 49 | END |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 50 | |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 51 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 52 | *** Keywords *** |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 53 | |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 54 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 55 | Test Setup Execution |
| 56 | [Documentation] Do the post test setup cleanup. |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 57 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 58 | Test System Cleanup |
George Keishing | 40abba2 | 2022-07-22 07:14:25 -0500 | [diff] [blame] | 59 | Run Keyword And Ignore Error Clear All Subscriptions |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 60 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 61 | |
| 62 | Test Teardown Execution |
| 63 | [Documentation] Do the post test teardown. |
| 64 | |
| 65 | FFDC On Test Case Fail |
| 66 | |
| 67 | |
| 68 | Suite Teardown Execution |
| 69 | [Documentation] Do the post suite teardown. |
| 70 | |
| 71 | Test System Cleanup |
| 72 | Run Keyword And Ignore Error Delete All Redfish Sessions |
| 73 | |
| 74 | |
| 75 | Test System Cleanup |
| 76 | [Documentation] Cleanup errors before exiting. |
| 77 | |
| 78 | Run Keyword And Ignore Error Redfish Purge Event Log |
| 79 | Run Keyword And Ignore Error Redfish Delete All BMC Dumps |
| 80 | Run Keyword And Ignore Error Redfish Delete All System Dumps |
| 81 | |
| 82 | |
| 83 | Redfish Initiated MPIPL |
| 84 | [Documentation] Trigger redfish triggered MPIPL flow. |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 85 | |
| 86 | # Power on |
| 87 | Redfish Power On |
| 88 | |
| 89 | # Trigger MPIPL |
George Keishing | 40abba2 | 2022-07-22 07:14:25 -0500 | [diff] [blame] | 90 | Log To Console Trigger System dump |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 91 | ${payload} = Create Dictionary |
| 92 | ... DiagnosticDataType=OEM OEMDiagnosticDataType=System |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 93 | Redfish.Post ${DUMP_URI}/Actions/LogService.CollectDiagnosticData body=&{payload} |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 94 | ... valid_status_codes=[${HTTP_ACCEPTED}] |
| 95 | |
George Keishing | 40abba2 | 2022-07-22 07:14:25 -0500 | [diff] [blame] | 96 | Sleep 10s |
| 97 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 98 | Log To Console Wait for system to transition DiagnosticMode |
George Keishing | 40abba2 | 2022-07-22 07:14:25 -0500 | [diff] [blame] | 99 | Wait Until Keyword Succeeds 2 min 3 sec Is Boot Progress Changed |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 100 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 101 | Log To Console Wait for system to transition path DiagnosticMode to Runtime. |
| 102 | Wait Until Keyword Succeeds 10 min 20 sec Is Boot Progress Runtime Matched |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 103 | |
| 104 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 105 | Is Boot Progress Runtime Matched |
| 106 | [Documentation] Get BootProgress state and expect boot state mismatch. |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 107 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 108 | # Match any of the BootProgress state SystemHardwareInitializationComplete|OSBootStarted|OSRunning |
| 109 | ${boot_progress} ${host_state}= Redfish Get Boot Progress |
| 110 | Should Contain Any ${boot_progress} SystemHardwareInitializationComplete OSBootStarted OSRunning |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 111 | |
Sandhya Somashekar | 0f44c8e | 2020-11-20 06:06:56 -0600 | [diff] [blame] | 112 | |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 113 | Required Dumps Should Exist |
| 114 | [Documentation] Check for BMC and system dump. |
| 115 | |
| 116 | # { |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 117 | # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4", |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 118 | # "@odata.type": "#LogEntry.v1_8_0.LogEntry", |
| 119 | # "AdditionalDataSizeBytes": 914254, |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 120 | # "AdditionalDataURI": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4/attachment", |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 121 | # "Created": "2022-07-22T03:36:23+00:00", |
| 122 | # "DiagnosticDataType": "Manager", |
| 123 | # "EntryType": "Event", |
| 124 | # "Id": "4", |
| 125 | # "Name": "BMC Dump Entry" |
| 126 | # } |
ganesanb | 4d43028 | 2023-04-27 14:33:23 +0000 | [diff] [blame] | 127 | ${bmc_dump}= Redfish.Get Properties /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries |
George Keishing | 9480af5 | 2022-07-22 00:08:00 -0500 | [diff] [blame] | 128 | Log To Console BMC dumps generated: ${bmc_dump['Members@odata.count']} |
| 129 | Should Be True ${bmc_dump['Members@odata.count']} >= 1 msg=No BMC dump generated. |
| 130 | |
| 131 | #"Members": [ |
| 132 | # { |
| 133 | # "@odata.id": "/redfish/v1/Systems/system/LogServices/Dump/Entries/System_1", |
| 134 | # "@odata.type": "#LogEntry.v1_8_0.LogEntry", |
| 135 | # "AdditionalDataSizeBytes": 2363839216, |
| 136 | # "AdditionalDataURI": "/redfish/v1/Systems/system/LogServices/Dump/Entries/System_1/attachment", |
| 137 | # "Created": "2022-07-22T03:38:58+00:00", |
| 138 | # "DiagnosticDataType": "OEM", |
| 139 | # "EntryType": "Event", |
| 140 | # "Id": "System_1", |
| 141 | # "Name": "System Dump Entry", |
| 142 | # "OEMDiagnosticDataType": "System" |
| 143 | # } |
| 144 | ${sys_dump}= Redfish.Get Properties /redfish/v1/Systems/system/LogServices/Dump/Entries |
| 145 | Log To Console System dump generated: ${sys_dump['Members@odata.count']} |
| 146 | Should Be True ${sys_dump['Members@odata.count']} == 1 msg=No system dump generated. |
George Keishing | c69c45a | 2022-12-06 03:31:43 -0600 | [diff] [blame] | 147 | |
| 148 | |
| 149 | Clear All Subscriptions |
| 150 | [Documentation] Delete all subscriptions. |
| 151 | |
| 152 | ${subscriptions}= Redfish.Get Attribute /redfish/v1/EventService/Subscriptions Members |
| 153 | FOR ${subscription} IN @{subscriptions} |
| 154 | Redfish.Delete ${subscription['@odata.id']} |
| 155 | END |