blob: 5fd05076fb6f99cae45a80f0c2f0f410bc1d282d [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
George Keishing7c32f302023-10-10 16:11:46 +053019Force Tags MPIPL_Basic
20
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060021*** Variables ***
22
George Keishing9480af52022-07-22 00:08:00 -050023# 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 Somashekar0f44c8e2020-11-20 06:06:56 -060027
28** Test Cases **
29
George Keishing9480af52022-07-22 00:08:00 -050030Trigger 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 Somashekar0f44c8e2020-11-20 06:06:56 -060034
George Keishing9480af52022-07-22 00:08:00 -050035 FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT}
36 Log To Console MPIPL LOOP_COUNT:${count} execution.
37 Tool Initd MP Reboot
George Keishing5e009792023-08-17 21:31:12 +053038 Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist
George Keishing9480af52022-07-22 00:08:00 -050039 END
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060040
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060041
George Keishing9480af52022-07-22 00:08:00 -050042Trigger 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 Somashekar0f44c8e2020-11-20 06:06:56 -060046
George Keishing9480af52022-07-22 00:08:00 -050047 FOR ${count} IN RANGE 0 ${MPIPL_LOOP_COUNT}
48 Log To Console MPIPL LOOP_COUNT:${count} execution.
49 Redfish Initiated MPIPL
George Keishing5e009792023-08-17 21:31:12 +053050 Wait Until Keyword Succeeds 5 min 10 sec Required Dumps Should Exist
George Keishing9480af52022-07-22 00:08:00 -050051 END
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060052
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060053
George Keishing9480af52022-07-22 00:08:00 -050054*** Keywords ***
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060055
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060056
George Keishing9480af52022-07-22 00:08:00 -050057Test Setup Execution
58 [Documentation] Do the post test setup cleanup.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060059
George Keishing9480af52022-07-22 00:08:00 -050060 Test System Cleanup
George Keishing40abba22022-07-22 07:14:25 -050061 Run Keyword And Ignore Error Clear All Subscriptions
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060062
George Keishing9480af52022-07-22 00:08:00 -050063
64Test Teardown Execution
65 [Documentation] Do the post test teardown.
66
67 FFDC On Test Case Fail
68
69
70Suite 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
77Test 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
85Redfish Initiated MPIPL
86 [Documentation] Trigger redfish triggered MPIPL flow.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060087
88 # Power on
89 Redfish Power On
90
91 # Trigger MPIPL
George Keishing40abba22022-07-22 07:14:25 -050092 Log To Console Trigger System dump
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060093 ${payload} = Create Dictionary
94 ... DiagnosticDataType=OEM OEMDiagnosticDataType=System
George Keishing9480af52022-07-22 00:08:00 -050095 Redfish.Post ${DUMP_URI}/Actions/LogService.CollectDiagnosticData body=&{payload}
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -060096 ... valid_status_codes=[${HTTP_ACCEPTED}]
97
George Keishing40abba22022-07-22 07:14:25 -050098 Sleep 10s
99
George Keishing9480af52022-07-22 00:08:00 -0500100 Log To Console Wait for system to transition DiagnosticMode
George Keishing40abba22022-07-22 07:14:25 -0500101 Wait Until Keyword Succeeds 2 min 3 sec Is Boot Progress Changed
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600102
George Keishing9480af52022-07-22 00:08:00 -0500103 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 Somashekar0f44c8e2020-11-20 06:06:56 -0600105
106
George Keishing9480af52022-07-22 00:08:00 -0500107Is Boot Progress Runtime Matched
108 [Documentation] Get BootProgress state and expect boot state mismatch.
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600109
George Keishing9480af52022-07-22 00:08:00 -0500110 # 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 Somashekar0f44c8e2020-11-20 06:06:56 -0600113
Sandhya Somashekar0f44c8e2020-11-20 06:06:56 -0600114
George Keishing9480af52022-07-22 00:08:00 -0500115Required Dumps Should Exist
116 [Documentation] Check for BMC and system dump.
117
118 # {
ganesanb4d430282023-04-27 14:33:23 +0000119 # "@odata.id": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4",
George Keishing9480af52022-07-22 00:08:00 -0500120 # "@odata.type": "#LogEntry.v1_8_0.LogEntry",
121 # "AdditionalDataSizeBytes": 914254,
ganesanb4d430282023-04-27 14:33:23 +0000122 # "AdditionalDataURI": "/redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries/4/attachment",
George Keishing9480af52022-07-22 00:08:00 -0500123 # "Created": "2022-07-22T03:36:23+00:00",
124 # "DiagnosticDataType": "Manager",
125 # "EntryType": "Event",
126 # "Id": "4",
127 # "Name": "BMC Dump Entry"
128 # }
ganesanb4d430282023-04-27 14:33:23 +0000129 ${bmc_dump}= Redfish.Get Properties /redfish/v1/Managers/${MANAGER_ID}/LogServices/Dump/Entries
George Keishing9480af52022-07-22 00:08:00 -0500130 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 Huc32434a2024-01-11 17:33:10 -0800146 ${sys_dump}= Redfish.Get Properties /redfish/v1/Systems/${SYSTEM_ID}/LogServices/Dump/Entries
George Keishing9480af52022-07-22 00:08:00 -0500147 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 Keishingc69c45a2022-12-06 03:31:43 -0600149
150
151Clear 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