blob: 2f8e47cc21aee8f0a830bae917ee2f758e345cdd [file] [log] [blame]
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -06001*** Settings ***
George Keishing9480af52022-07-22 00:08:00 -05002Documentation Test MPIPL (Memory preserving IPL).
3
4#------------------------------------------------------------------
5# This boot path will generated a BMC dump followed by system dump.
6#------------------------------------------------------------------
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -06007
George Keishingd6ec8362021-05-27 14:25:06 -05008Resource ../../lib/resource.robot
9Resource ../../lib/openbmc_ffdc.robot
10Resource ../../lib/bmc_redfish_utils.robot
11Resource ../../lib/bmc_redfish_resource.robot
12Resource ../../lib/boot_utils.robot
13
George Keishing9480af52022-07-22 00:08:00 -050014Suite Setup Redfish.Login
George Keishing6e729282022-08-10 22:44:07 -050015Test Setup Test Setup Execution
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060016Test Teardown Test Teardown Execution
George Keishing9480af52022-07-22 00:08:00 -050017Suite Teardown Suite Teardown Execution
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060018
19*** Variables ***
20
George Keishing9480af52022-07-22 00:08:00 -050021# 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 Somashekar0f44c8e2020-11-20 06:06:56 -060025
26** Test Cases **
27
George Keishing9480af52022-07-22 00:08:00 -050028Trigger 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 Somashekar0f44c8e2020-11-20 06:06:56 -060032
George Keishing9480af52022-07-22 00:08:00 -050033 FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT}
34 Log To Console MPIPL LOOP_COUNT:${count} execution.
35 Tool Initd MP Reboot
George Keishing5e009792023-08-17 21:31:12 +053036 Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist
George Keishing9480af52022-07-22 00:08:00 -050037 END
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060038
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060039
George Keishing9480af52022-07-22 00:08:00 -050040Trigger 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 Somashekar0f44c8e2020-11-20 06:06:56 -060044
George Keishing9480af52022-07-22 00:08:00 -050045 FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT}
46 Log To Console MPIPL LOOP_COUNT:${count} execution.
47 Redfish Initiated MPIPL
George Keishing5e009792023-08-17 21:31:12 +053048 Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist
George Keishing9480af52022-07-22 00:08:00 -050049 END
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060050
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060051
George Keishing9480af52022-07-22 00:08:00 -050052*** Keywords ***
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060053
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060054
George Keishing9480af52022-07-22 00:08:00 -050055Test Setup Execution
56 [Documentation] Do the post test setup cleanup.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060057
George Keishing9480af52022-07-22 00:08:00 -050058 Test System Cleanup
George Keishing40abba22022-07-22 07:14:25 -050059 Run Keyword And Ignore Error Clear All Subscriptions
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060060
George Keishing9480af52022-07-22 00:08:00 -050061
62Test Teardown Execution
63 [Documentation] Do the post test teardown.
64
65 FFDC On Test Case Fail
66
67
68Suite 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
75Test 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
83Redfish Initiated MPIPL
84 [Documentation] Trigger redfish triggered MPIPL flow.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060085
86 # Power on
87 Redfish Power On
88
89 # Trigger MPIPL
George Keishing40abba22022-07-22 07:14:25 -050090 Log To Console Trigger System dump
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060091 ${payload} = Create Dictionary
92 ... DiagnosticDataType=OEM OEMDiagnosticDataType=System
George Keishing9480af52022-07-22 00:08:00 -050093 Redfish.Post ${DUMP_URI}/Actions/LogService.CollectDiagnosticData body=&{payload}
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060094 ... valid_status_codes=[${HTTP_ACCEPTED}]
95
George Keishing40abba22022-07-22 07:14:25 -050096 Sleep 10s
97
George Keishing9480af52022-07-22 00:08:00 -050098 Log To Console Wait for system to transition DiagnosticMode
George Keishing40abba22022-07-22 07:14:25 -050099 Wait Until Keyword Succeeds 2 min 3 sec Is Boot Progress Changed
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600100
George Keishing9480af52022-07-22 00:08:00 -0500101 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 Somashekar0f44c8e2020-11-20 06:06:56 -0600103
104
George Keishing9480af52022-07-22 00:08:00 -0500105Is Boot Progress Runtime Matched
106 [Documentation] Get BootProgress state and expect boot state mismatch.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600107
George Keishing9480af52022-07-22 00:08:00 -0500108 # 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 Somashekar0f44c8e2020-11-20 06:06:56 -0600111
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600112
George Keishing9480af52022-07-22 00:08:00 -0500113Required Dumps Should Exist
114 [Documentation] Check for BMC and system dump.
115
116 # {
ganesanb4d430282023-04-27 14:33:23 +0000117 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4",
George Keishing9480af52022-07-22 00:08:00 -0500118 # "@odata.type": "#LogEntry.v1_8_0.LogEntry",
119 # "AdditionalDataSizeBytes": 914254,
ganesanb4d430282023-04-27 14:33:23 +0000120 # "AdditionalDataURI": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4/attachment",
George Keishing9480af52022-07-22 00:08:00 -0500121 # "Created": "2022-07-22T03:36:23+00:00",
122 # "DiagnosticDataType": "Manager",
123 # "EntryType": "Event",
124 # "Id": "4",
125 # "Name": "BMC Dump Entry"
126 # }
ganesanb4d430282023-04-27 14:33:23 +0000127 ${bmc_dump}= Redfish.Get Properties /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
George Keishing9480af52022-07-22 00:08:00 -0500128 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 Keishingc69c45a2022-12-06 03:31:43 -0600147
148
149Clear 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