Remove the hardcoding for IPMI Prefix value
Changes:
Resolves openbmc-test-automation/issues/#2251
Create a new input argument as ${IPMI_RAW_PREFIX}
This enable the user to provide the IPMI_RAW_PREFIX from the CLI as
e.g. -v IPMI_RAW_PREFIX:'0xaa 0xbb 0x'
Tested:
Tested changes on BMC environment
Change-Id: I10f30e59cf6fe8af80b421233ad241513a138614
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/esel_utils.robot b/lib/esel_utils.robot
index 5af58dd..3e6a638 100755
--- a/lib/esel_utils.robot
+++ b/lib/esel_utils.robot
@@ -9,8 +9,6 @@
*** Variables ***
-${RAW_PREFIX} raw 0x3a 0xf0 0x
-
${RESERVE_ID} raw 0x0a 0x42
${RAW_SUFFIX} 0x00 0x00 0x00 0x00 0x00 0x01 0x00 0x00
@@ -24,16 +22,24 @@
Create eSEL
[Documentation] Create an eSEL.
+ [Arguments] ${IPMI_RAW_PREFIX}
+
+ # Description of Argument(s):
+ # IPMI_RAW_PREFIX Provide the IPMI raw prefix format
+ # Default is '0x3a 0xf0 0x'.
+
Open Connection And Log In
${Resv_id}= Run Inband IPMI Standard Command ${RESERVE_ID}
${cmd}= Catenate
- ... ${RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
+ ... raw ${IPMI_RAW_PREFIX}${Resv_id.strip().rsplit(' ', 1)[0]} ${RAW_SUFFIX}
+
Run Inband IPMI Standard Command ${cmd}
Run Inband IPMI Standard Command ${RAW_SEL_COMMIT}
Count eSEL Entries
[Documentation] Count eSEL entries logged.
+
${resp}= OpenBMC Get Request ${BMC_LOGGING_ENTRY}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
${count}= Get Length ${resp.json()["data"]}
diff --git a/redfish/systems/eventlog/test_esel.robot b/redfish/systems/eventlog/test_esel.robot
index 7534520..5185d24 100644
--- a/redfish/systems/eventlog/test_esel.robot
+++ b/redfish/systems/eventlog/test_esel.robot
@@ -19,11 +19,13 @@
*** Variables ***
-${stack_mode} skip
+${stack_mode} skip
-${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
+${LOGGING_SERVICE} xyz.openbmc_project.Logging.service
-${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
+${ESEL_DATA} ESEL=00 00 df 00 00 00 00 20 00 04 12 35 6f aa 00 00
+
+${IPMI_RAW_PREFIX} 0x3a 0xf0 0x
*** Test Cases ***
@@ -31,7 +33,7 @@
[Documentation] Generate eSEL log and verify using redfish.
[Tags] Verify_eSEL_Using_Redfish
- Create eSEL
+ Create eSEL ${IPMI_RAW_PREFIX}
Event Log Should Exist
@@ -39,7 +41,7 @@
[Documentation] Verify that eSEL entries have data.
[Tags] Verify_eSEL_Entries_Using_Redfish
- Create eSEL
+ Create eSEL ${IPMI_RAW_PREFIX}
Redfish.Login
Verify eSEL Entries
@@ -72,7 +74,7 @@
# ]
# ]
- Create eSEL
+ Create eSEL ${IPMI_RAW_PREFIX}
${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
${desc}= Read Attribute ${elog_entry[0]} Description
@@ -87,8 +89,7 @@
[Documentation] Generate multiple eSEL log and verify using redfish
[Tags] Verify_Multiple_eSEL_Using_Redfish
- Create eSEL
- Create eSEL
+ Create eSEL ${IPMI_RAW_PREFIX}
${entries}= Count eSEL Entries
Should Be Equal As Integers ${entries} ${2}
... msg=Expecting 2 eSELs but found ${entries}.
@@ -100,7 +101,7 @@
... not empty.
[Tags] Check_eSEL_AdditionalData
- Create eSEL
+ Create eSEL ${IPMI_RAW_PREFIX}
${elog_entry}= Get URL List ${BMC_LOGGING_ENTRY}
${resp}= OpenBMC Get Request ${elog_entry[0]}
Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
@@ -126,7 +127,7 @@
${rev_id_ms}= Get Substring ${rev_id_1} -2
Run Inband IPMI Raw Command 0x0a 0x42
${output}= Check IPMI OEMpartialadd Reject
- ... 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
+ ... ${IPMI_RAW_PREFIX}${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Should Contain ${output} Reservation cancelled
Test Correct Reservation_ID
@@ -141,7 +142,7 @@
${rev_id_ls}= Get Substring ${rev_id_2} 1 3
${rev_id_ms}= Get Substring ${rev_id_2} -2
${output}= Check IPMI OEMpartialadd Accept
- ... 0x3a 0xf0 0x${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
+ ... ${IPMI_RAW_PREFIX}${rev_id_ls} 0x${rev_id_ms} 0 0 0 0 0 1 2 3 4 5 6 7 8 9 0xa 0xb 0xc 0xd 0xe 0xf
Should Be Empty ${output}
@@ -166,6 +167,11 @@
Run IPMI Command Returned
[Documentation] Run the IPMI command and return the output.
[Arguments] ${args}
+
+ # Description of Argument(s):
+ # args IPMI raw data
+ # (e.g: 0x00 0x03 0x03).
+
${output_1}= Execute Command /tmp/ipmitool -I dbus raw ${args}
RETURN ${output_1}
@@ -173,6 +179,11 @@
Check IPMI OEMpartialadd Reject
[Documentation] Check if IPMI rejects the OEM partial add command.
[Arguments] ${args}
+
+ # Description of Argument(s):
+ # args IPMI raw data
+ # (e.g: 0x00 0x03 0x03).
+
Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
${stdout} ${stderr} ${output_2}= Execute Command ipmitool raw ${args}
... return_stdout=True return_stderr=True return_rc=True
@@ -209,6 +220,11 @@
Check IPMI OEMpartialadd Accept
[Documentation] Check if IPMI accepts the OEM partial add command.
[Arguments] ${args}
+
+ # Description of Argument(s):
+ # args IPMI raw data
+ # (e.g: 0x00 0x03 0x03).
+
Login To OS Host ${OS_HOST} ${OS_USERNAME} ${OS_PASSWORD}
${stdout} ${stderr} ${output_3}= Execute Command ipmitool raw ${args}
... return_stdout=True return_stderr=True return_rc=True