blob: f9e3a99161b4225a8b8c88db270e3e2bcfd31163 [file] [log] [blame]
Sridevi Rameshfe52e402020-02-05 00:15:24 -06001*** Settings ***
2
3Documentation Module to test PLDM platform commands.
4
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -06005Library ../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
Sridevi Rameshfe52e402020-02-05 00:15:24 -060010
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -060011Test Setup Printn
12Test Teardown FFDC On Test Case Fail
13Suite Teardown Pldmtool Platform Suite Cleanup
Sridevi Rameshfe52e402020-02-05 00:15:24 -060014
15*** Test Cases ***
Sridevi Rameshfe52e402020-02-05 00:15:24 -060016Verify GetPDR
17 [Documentation] Verify GetPDR (Platform Descpritor Record) response message.
18 [Tags] Verify_GetPDR
Sridevi Rameshfe52e402020-02-05 00:15:24 -060019
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050020 ${record_handle}= Set Variable ${1}
21 # Note: Record handle count is unknown and it is dynamic in nature.
22 # Assuming there are 100 record handle.
23 FOR ${i} IN RANGE 100
24 ${next_record_handle}= Run Keyword Verify GetPDR For Record Handle ${record_handle}
25 Exit For Loop If ${next_record_handle} == 0
26 ${record_handle}= Set Variable ${next_record_handle}
27 END
Sridevi Rameshfe52e402020-02-05 00:15:24 -060028
29Verify SetStateEffecterStates
30 [Documentation] Verify set state effecter states response message.
31 [Tags] Verify_SetStateEffecterStates
32 [Template] Verify SetStateEffecterStates For Effecter States
33
Sridevi Rameshca3223a2020-03-11 03:58:58 -050034 # EffecterHandle Count EffecterStates (effecterID effecterState)
35
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050036 '1' '1' '1 1' # (effecterState -> 1 -> 'Boot Not Active')
37 '1' '1' '1 2' # (effecterState -> 2 -> 'Boot Completed')
38 '2' '1' '1 9' # (effecterState -> 9 -> 'System Power is in soft off mode')
39 '3' '1' '1 6' # (effecterState -> 6 -> 'Graceful Restart Requested')
Sridevi Rameshfe52e402020-02-05 00:15:24 -060040
41*** Keywords ***
42
43Verify GetPDR For Record Handle
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050044 [Documentation] Verify GetPDR (Platform Descpritor Record) for given input
45 ... record handle and return next record handle.
Sridevi Rameshfe52e402020-02-05 00:15:24 -060046 [Arguments] ${record_handle}
47
48 # Description of argument(s):
Sridevi Rameshca3223a2020-03-11 03:58:58 -050049 # ${record_handle} Record handle.
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050050 # e.g. '1' is record handle 'Boot Progress' (196).
51 # '2' is record handle 'System Power State (260)'.
52 # '3' is record handle 'Software Termination Status (129)'.
Sridevi Rameshfe52e402020-02-05 00:15:24 -060053
54 # pldm_output:
55 # [responseCount]: 29
56 # [recordHandle]: 1
57 # [PDRHeaderVersion]: 1
58 # [PDRType]: 11
59 # [recordChangeNumber]: 0
60 # [dataLength]: 19
61 # [PLDMTerminusHandle]: 0
62 # [effecterID]: 1
63 # [entityType]: 33
64 # [entityInstanceNumber]: 0
65 # [containerID]: 0
66 # [effecterSemanticID]: 0
67 # [effecterInit]: 0
68 # [effecterDescriptionPDR]: false
69 # [compositeEffecterCount]: 1
70 # [stateSetID]: 196
71 # [possibleStatesSize]: 1
72 # [possibleStates]: 6
73
74 ${pldm_cmd}= Evaluate $CMD_GETPDR % ${record_handle}
75 ${pldm_output}= Pldmtool ${pldm_cmd}
76 Rprint Vars pldm_output
Sridevi Rameshda95c472020-07-28 06:51:48 -050077
Sridevi Ramesh961050b2020-11-12 11:04:30 -060078 Run Keyword If '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}'
79 ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_SETSTATEEFFECTER}
Sridevi Rameshda95c472020-07-28 06:51:48 -050080
Sridevi Ramesh961050b2020-11-12 11:04:30 -060081 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_FRU_RECORD_SET']}'
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050082 ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER}
Sridevi Rameshdfc7fcb2020-07-23 03:03:57 -050083
Sridevi Ramesh961050b2020-11-12 11:04:30 -060084 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}'
85 ... Log To Console "Found PDR Type - PLDM_ENTITY_ASSOCIATION_PDR"
Sridevi Rameshdfc7fcb2020-07-23 03:03:57 -050086
Sridevi Ramesh961050b2020-11-12 11:04:30 -060087 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}'
Sridevi Rameshda95c472020-07-28 06:51:48 -050088 ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_STATESENSORPDR}
Sridevi Rameshdfc7fcb2020-07-23 03:03:57 -050089
Sridevi Ramesh961050b2020-11-12 11:04:30 -060090 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}'
91 ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_NUMERICEFFECTERPDR}
Sridevi Rameshdfc7fcb2020-07-23 03:03:57 -050092
Sridevi Ramesh961050b2020-11-12 11:04:30 -060093 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}'
94 ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_TERMINUSLOCATORPDR}
95
96 ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_COMPACT_NUMERIC_SENSOR_PDR']}'
97 ... Log To Console "Found PDR Type - PLDM_COMPACT_NUMERIC_SENSOR_PDR'
Sridevi Rameshdfc7fcb2020-07-23 03:03:57 -050098
Sridevi Rameshda95c472020-07-28 06:51:48 -050099 ... ELSE Fail msg="Unknown PDR Type is received"
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600100
Sridevi Ramesh961050b2020-11-12 11:04:30 -0600101 Should be equal as strings ${pldm_output['recordHandle']} ${record_handle}
102 [Return] ${pldm_output['nextRecordHandle']}
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600103
104Verify SetStateEffecterStates For Effecter States
105 [Documentation] Verify set state effecter states for given input effecter states.
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500106 [Arguments] ${effecter_handle} ${count} ${effecter_states}
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600107
108 # Description of argument(s):
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500109 # ${effecter_handle} A handle that is used to identify and access the effecter (e.g. '1').
110 # e.g. '1' is effecter handle 'Boot Progress'.
111 # '2' is effecter handle 'System Power State'.
112 # ${count} The number of individual sets of effecter information (e.g. '1').
113 # ${effecter_states} (effecterID effecterState).
114 # e.g. '1 1'.
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600115
116 # Example output:
Sridevi Ramesh961050b2020-11-12 11:04:30 -0600117 # {
118 # "Response": "SUCCESS"
119 # }
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600120
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500121 ${pldm_cmd}= Evaluate $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states})
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600122 ${pldm_output}= Pldmtool ${pldm_cmd}
123 Rprint Vars pldm_output
Sridevi Ramesh961050b2020-11-12 11:04:30 -0600124 Valid Value pldm_output['Response'] ['SUCCESS']
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -0600125
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -0600126Pldmtool Platform Suite Cleanup
127 [Documentation] Reset BMC at suite cleanup.
128
George Keishing64fdf622020-06-18 02:49:38 -0500129 Redfish.Login
Sridevi Ramesh88f21722020-04-16 05:54:02 -0500130 Redfish Hard Power Off
Sridevi Ramesh072d5af2020-06-02 09:20:57 -0500131 Redfish Power On
George Keishing64fdf622020-06-18 02:49:38 -0500132 Redfish.Logout