xref: /openbmc/openbmc-test-automation/pldm/test_pldm_platform.robot (revision fc3b07f7256cc5eaafd82d23d81e24d44e7790be)
1*** Settings ***
2
3Documentation    Module to test PLDM platform commands.
4
5Library           ../lib/pldm_utils.py
6Variables         ../data/pldm_variables.py
7Resource          ../lib/openbmc_ffdc.robot
8Resource          ../lib/bmc_redfish_resource.robot
9Resource          ../lib/boot_utils.robot
10
11Test Setup        Printn
12Test Teardown     FFDC On Test Case Fail
13Suite Teardown    Pldmtool Platform Suite Cleanup
14
15*** Test Cases ***
16
17Verify GetPDR
18    [Documentation]  Verify GetPDR (Platform Descpritor Record) response message.
19    [Tags]  Verify_GetPDR
20    [Template]  Verify GetPDR For Record Handle
21
22    # RecordHandle
23    '0'
24    '1'
25    '2'
26
27
28Verify SetStateEffecterStates
29    [Documentation]  Verify set state effecter states response message.
30    [Tags]  Verify_SetStateEffecterStates
31    [Template]  Verify SetStateEffecterStates For Effecter States
32
33    # EffecterStates (effecterID requestSet effecterState)
34    '1 1 1'  # (effecterState -> 1 move OSStatus to 'standby')
35    '1 1 2'  # (effecterState -> 2 move OSStatus to 'BootComplete')
36
37*** Keywords ***
38
39Verify GetPDR For Record Handle
40    [Documentation]  Verify GetPDR (Platform Descpritor Record) for given input record handle.
41    [Arguments]  ${record_handle}
42
43    # Description of argument(s):
44    # ${record_handle}  Record handle (e.g. '1').
45
46    # pldm_output:
47    # [responseCount]:                               29
48    # [recordHandle]:                                1
49    # [PDRHeaderVersion]:                            1
50    # [PDRType]:                                     11
51    # [recordChangeNumber]:                          0
52    # [dataLength]:                                  19
53    # [PLDMTerminusHandle]:                          0
54    # [effecterID]:                                  1
55    # [entityType]:                                  33
56    # [entityInstanceNumber]:                        0
57    # [containerID]:                                 0
58    # [effecterSemanticID]:                          0
59    # [effecterInit]:                                0
60    # [effecterDescriptionPDR]:                      false
61    # [compositeEffecterCount]:                      1
62    # [stateSetID]:                                  196
63    # [possibleStatesSize]:                          1
64    # [possibleStates]:                              6
65
66    ${pldm_cmd}=  Evaluate  $CMD_GETPDR % ${record_handle}
67    ${pldm_output}=  Pldmtool  ${pldm_cmd}
68    Rprint Vars  pldm_output
69    Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR}
70
71
72Verify SetStateEffecterStates For Effecter States
73    [Documentation]  Verify set state effecter states for given input effecter states.
74    [Arguments]  ${effecter_states}
75
76    # Description of argument(s):
77    # ${effecter_states}   (effecterID requestSet effecterState).
78    #                      e.g. '1 1 1'.
79
80    # Example output:
81    # SetStateEffecterStates ]: SUCCESS
82
83    ${pldm_cmd}=  Evaluate  $CMD_SETSTATEEFFECTERSTATES % ${effecter_states}
84    ${pldm_output}=  Pldmtool  ${pldm_cmd}
85    Rprint Vars  pldm_output
86    Valid Value  pldm_output['setstateeffecterstates']  ['SUCCESS']
87
88
89Pldmtool Platform Suite Cleanup
90    [Documentation]    Reset BMC at suite cleanup.
91
92    Redfish OBMC Reboot (off)
93