1*** Settings ***
2Documentation    Test MPIPL.
3
4Resource         ../../lib/resource.robot
5Resource         ../../lib/openbmc_ffdc.robot
6Resource         ../../lib/bmc_redfish_utils.robot
7Resource         ../../lib/bmc_redfish_resource.robot
8Resource         ../../lib/boot_utils.robot
9
10Test Teardown    Test Teardown Execution
11
12*** Variables ***
13
14${user_initated_mpipl}  systemctl start obmc-host-crash@0.target
15
16** Test Cases **
17
18Trigger And Verify User Initiated Dump Using Diagnostic Mode Target
19    [Documentation]  Trigger And Verify user initiated dump using diagnostic mode target
20    [Tags]  Trigger_And_Verify_User_Initiated_Dump_Using_Diagnostic_Mode_Target
21
22    Redfish.Login
23
24    # Power off
25    Redfish Power Off
26
27    # Power on
28    Redfish Power On
29
30    # Trigger MPIPL
31    BMC Execute Command  ${user_initated_mpipl}
32    Sleep  240
33
34    # Confirm boot after MPIPL
35    ${res}  ${stderr}  ${rc} =  BMC Execute Command  obmcutil state
36    Should Contain  ${res}  OSStatus.Standby
37
38    ${p0_cfam}  ${stderr}  ${rc} =  BMC Execute Command  pdbg -p0 getcfam 0x2809
39    Should Contain  ${p0_cfam}  0x854
40    Printn  ${p0_cfam}
41
42    ${p1_cfam}  ${stderr}  ${rc} =  BMC Execute Command  pdbg -p1 getcfam 0x2809
43    Should Contain  ${p1_cfam}  0x854
44    Printn  ${p1_cfam}
45
46Trigger And Verify User Initiated Dump Using Redfish
47    [Documentation]  Verify redfish triggered MPIPL flow
48    [Tags]  Trigger_And_Verify_User_Initiated_Dump_Using_Redfish
49
50    Redfish.Login
51
52    # Power off
53    Redfish Power Off
54
55    # Power on
56    Redfish Power On
57
58    # Trigger MPIPL
59    ${payload} =  Create Dictionary
60    ...  DiagnosticDataType=OEM  OEMDiagnosticDataType=System
61    Redfish.Post  ${DUMP_URI}/Dump/Actions/LogService.CollectDiagnosticData  body=&{payload}
62    ...  valid_status_codes=[${HTTP_ACCEPTED}]
63
64    ${p0_cfam}  ${stderr}  ${rc} =  BMC Execute Command  pdbg -p0 getcfam 0x2809
65    Should Contain  ${p0_cfam}  0x854
66    Printn  ${p0_cfam}
67
68    ${p1_cfam}  ${stderr}  ${rc} =  BMC Execute Command  pdbg -p1 getcfam 0x2809
69    Should Contain  ${p1_cfam}  0x854
70    Printn  ${p1_cfam}
71
72
73*** Keywords ***
74
75Test Teardown Execution
76    [Documentation]  Do the post test teardown.
77
78    Run Keyword And Ignore Error  Redfish.Logout
79    FFDC On Test Case Fail
80
81