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    # EffecterHandle  Count  EffecterStates (effecterID effecterState)
34
35    '1'  '1'  '1 1'  # (effecterState -> 1 -> 'Boot Not Active')
36    '1'  '1'  '1 2'  # (effecterState -> 2 -> 'Boot Completed')
37    '2'  '1'  '1 9'  # (effecterState -> 9 -> 'System Power is in soft off mode')
38
39*** Keywords ***
40
41Verify GetPDR For Record Handle
42    [Documentation]  Verify GetPDR (Platform Descpritor Record) for given input record handle.
43    [Arguments]  ${record_handle}
44
45    # Description of argument(s):
46    # ${record_handle}  Record handle.
47    #                   e.g. '1' is record handle 'Boot Progress'.
48    #                        '2' is record handle 'System Power State'.
49
50    # pldm_output:
51    # [responseCount]:                               29
52    # [recordHandle]:                                1
53    # [PDRHeaderVersion]:                            1
54    # [PDRType]:                                     11
55    # [recordChangeNumber]:                          0
56    # [dataLength]:                                  19
57    # [PLDMTerminusHandle]:                          0
58    # [effecterID]:                                  1
59    # [entityType]:                                  33
60    # [entityInstanceNumber]:                        0
61    # [containerID]:                                 0
62    # [effecterSemanticID]:                          0
63    # [effecterInit]:                                0
64    # [effecterDescriptionPDR]:                      false
65    # [compositeEffecterCount]:                      1
66    # [stateSetID]:                                  196
67    # [possibleStatesSize]:                          1
68    # [possibleStates]:                              6
69
70    ${pldm_cmd}=  Evaluate  $CMD_GETPDR % ${record_handle}
71    ${pldm_output}=  Pldmtool  ${pldm_cmd}
72    Rprint Vars  pldm_output
73    Valid Dict  pldm_output  valid_values=${RESPONSE_DICT_GETPDR}
74
75
76Verify SetStateEffecterStates For Effecter States
77    [Documentation]  Verify set state effecter states for given input effecter states.
78    [Arguments]  ${effecter_handle}  ${count}  ${effecter_states}
79
80    # Description of argument(s):
81    # ${effecter_handle}   A handle that is used to identify and access the effecter (e.g. '1').
82    #                      e.g. '1' is effecter handle 'Boot Progress'.
83    #                           '2' is effecter handle 'System Power State'.
84    # ${count}             The number of individual sets of effecter information (e.g. '1').
85    # ${effecter_states}   (effecterID effecterState).
86    #                      e.g. '1 1'.
87
88    # Example output:
89    # SetStateEffecterStates ]: SUCCESS
90
91    ${pldm_cmd}=  Evaluate  $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states})
92    ${pldm_output}=  Pldmtool  ${pldm_cmd}
93    Rprint Vars  pldm_output
94    Valid Value  pldm_output['setstateeffecterstates']  ['SUCCESS']
95
96
97Pldmtool Platform Suite Cleanup
98    [Documentation]    Reset BMC at suite cleanup.
99
100    Redfish OBMC Reboot (off)
101