blob: cb933bd8e4a34145b9398dffabc4be08627a73a9 [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
George Keishingaa2329b2025-04-25 22:26:12 +053015Test Tags Pldm_Platform
George Keishing54316852023-10-16 14:03:29 +053016
Sridevi Rameshfe52e402020-02-05 00:15:24 -060017*** Test Cases ***
Sridevi Rameshfe52e402020-02-05 00:15:24 -060018Verify GetPDR
19 [Documentation] Verify GetPDR (Platform Descpritor Record) response message.
20 [Tags] Verify_GetPDR
Sridevi Rameshfe52e402020-02-05 00:15:24 -060021
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050022 ${record_handle}= Set Variable ${1}
23 # Note: Record handle count is unknown and it is dynamic in nature.
24 # Assuming there are 100 record handle.
25 FOR ${i} IN RANGE 100
26 ${next_record_handle}= Run Keyword Verify GetPDR For Record Handle ${record_handle}
George Keishingaa2329b2025-04-25 22:26:12 +053027 IF ${next_record_handle} == 0 BREAK
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050028 ${record_handle}= Set Variable ${next_record_handle}
29 END
Sridevi Rameshfe52e402020-02-05 00:15:24 -060030
31Verify SetStateEffecterStates
32 [Documentation] Verify set state effecter states response message.
33 [Tags] Verify_SetStateEffecterStates
34 [Template] Verify SetStateEffecterStates For Effecter States
35
Sridevi Rameshca3223a2020-03-11 03:58:58 -050036 # EffecterHandle Count EffecterStates (effecterID effecterState)
37
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050038 '1' '1' '1 1' # (effecterState -> 1 -> 'Boot Not Active')
39 '1' '1' '1 2' # (effecterState -> 2 -> 'Boot Completed')
40 '2' '1' '1 9' # (effecterState -> 9 -> 'System Power is in soft off mode')
41 '3' '1' '1 6' # (effecterState -> 6 -> 'Graceful Restart Requested')
Sridevi Rameshfe52e402020-02-05 00:15:24 -060042
43*** Keywords ***
44
45Verify GetPDR For Record Handle
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050046 [Documentation] Verify GetPDR (Platform Descpritor Record) for given input
47 ... record handle and return next record handle.
Sridevi Rameshfe52e402020-02-05 00:15:24 -060048 [Arguments] ${record_handle}
49
50 # Description of argument(s):
Sridevi Rameshca3223a2020-03-11 03:58:58 -050051 # ${record_handle} Record handle.
Sridevi Ramesh538d18d2020-03-30 11:45:42 -050052 # e.g. '1' is record handle 'Boot Progress' (196).
53 # '2' is record handle 'System Power State (260)'.
54 # '3' is record handle 'Software Termination Status (129)'.
Sridevi Rameshfe52e402020-02-05 00:15:24 -060055
56 # pldm_output:
57 # [responseCount]: 29
58 # [recordHandle]: 1
59 # [PDRHeaderVersion]: 1
60 # [PDRType]: 11
61 # [recordChangeNumber]: 0
62 # [dataLength]: 19
63 # [PLDMTerminusHandle]: 0
64 # [effecterID]: 1
65 # [entityType]: 33
66 # [entityInstanceNumber]: 0
67 # [containerID]: 0
68 # [effecterSemanticID]: 0
69 # [effecterInit]: 0
70 # [effecterDescriptionPDR]: false
71 # [compositeEffecterCount]: 1
72 # [stateSetID]: 196
73 # [possibleStatesSize]: 1
74 # [possibleStates]: 6
75
76 ${pldm_cmd}= Evaluate $CMD_GETPDR % ${record_handle}
77 ${pldm_output}= Pldmtool ${pldm_cmd}
78 Rprint Vars pldm_output
Sridevi Rameshda95c472020-07-28 06:51:48 -050079
George Keishingaa2329b2025-04-25 22:26:12 +053080 IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}'
81 Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_SETSTATEEFFECTER}
82 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_FRU_RECORD_SET']}'
83 Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER}
84 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}'
85 Log To Console "Found PDR Type - PLDM_ENTITY_ASSOCIATION_PDR"
86 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}'
87 Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_STATESENSORPDR}
88 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}'
89 Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_NUMERICEFFECTERPDR}
90 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}'
91 Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_TERMINUSLOCATORPDR}
92 ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_COMPACT_NUMERIC_SENSOR_PDR']}'
93 Log To Console "Found PDR Type - PLDM_COMPACT_NUMERIC_SENSOR_PDR'
94 ELSE
95 Fail msg="Unknown PDR Type is received"
96 END
Sridevi Rameshda95c472020-07-28 06:51:48 -050097
George Keishingaa2329b2025-04-25 22:26:12 +053098 Should Be Equal As Strings ${pldm_output['recordHandle']} ${record_handle}
George Keishing409df052024-01-17 22:36:14 +053099 RETURN ${pldm_output['nextRecordHandle']}
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600100
101Verify SetStateEffecterStates For Effecter States
102 [Documentation] Verify set state effecter states for given input effecter states.
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500103 [Arguments] ${effecter_handle} ${count} ${effecter_states}
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600104
105 # Description of argument(s):
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500106 # ${effecter_handle} A handle that is used to identify and access the effecter (e.g. '1').
107 # e.g. '1' is effecter handle 'Boot Progress'.
108 # '2' is effecter handle 'System Power State'.
109 # ${count} The number of individual sets of effecter information (e.g. '1').
110 # ${effecter_states} (effecterID effecterState).
111 # e.g. '1 1'.
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600112
113 # Example output:
Sridevi Ramesh961050b2020-11-12 11:04:30 -0600114 # {
115 # "Response": "SUCCESS"
116 # }
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600117
Sridevi Rameshca3223a2020-03-11 03:58:58 -0500118 ${pldm_cmd}= Evaluate $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states})
Sridevi Rameshfe52e402020-02-05 00:15:24 -0600119 ${pldm_output}= Pldmtool ${pldm_cmd}
120 Rprint Vars pldm_output
Sridevi Ramesh961050b2020-11-12 11:04:30 -0600121 Valid Value pldm_output['Response'] ['SUCCESS']
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -0600122
Sridevi Rameshfc3b07f2020-02-27 04:22:24 -0600123Pldmtool Platform Suite Cleanup
124 [Documentation] Reset BMC at suite cleanup.
125
George Keishing64fdf622020-06-18 02:49:38 -0500126 Redfish.Login
George Keishing92913a72022-09-19 12:58:00 -0500127 Redfish OBMC Reboot (off)