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