Add SEL Entry: Modified add sel entry command

Changes:
    - Generator ID in add sel entry command was given as 0x00 0x00.
    - Introduced generator id variable in lib/resource.robot and the variable is called in
      add sel entry command.
    - Modified data/ipmi_raw_cmd_table.py file as per generator id.

Tested:
     - Ran All The Scripts Successfully

Change-Id: I4503ca2667921c0681e1050c56fc32e173eacb03
Signed-off-by: ganesanb <ganesanb@ami.com>
diff --git a/data/ipmi_raw_cmd_table.py b/data/ipmi_raw_cmd_table.py
index 7f713b3..eecb83e 100644
--- a/data/ipmi_raw_cmd_table.py
+++ b/data/ipmi_raw_cmd_table.py
@@ -96,8 +96,9 @@
             "0x0a 0x40"
         ],
         "Create_SEL": [
-            # raw command
-            "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04",
+            # raw command, expected output, comment
+            "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00",
+            "0x04",
             "0x00 0xa0 0x04 0x07",
         ],
         "Get_SEL_Entry": [
diff --git a/lib/ipmi_client.robot b/lib/ipmi_client.robot
index 285c330..8328089 100755
--- a/lib/ipmi_client.robot
+++ b/lib/ipmi_client.robot
@@ -494,8 +494,11 @@
     #                              obtained from Sensor ID field in - ipmitool sdr get "sensor_name".
     #                              Example: Sensor ID : SENSOR_1 (0xHH), here 0xHH is sensor number.
 
-    ${resp}=  Run IPMI Command
-    ...  ${IPMI_RAW_CMD['SEL_entry']['Create_SEL'][0]} 0x${sensor_type} 0x${sensor_number} ${IPMI_RAW_CMD['SEL_entry']['Create_SEL'][1]}
+    ${cmd}=  Catenate  ${IPMI_RAW_CMD['SEL_entry']['Create_SEL'][0]} 0x${GEN_ID_BYTE_1} 0x${GEN_ID_BYTE_2}
+    ...  ${IPMI_RAW_CMD['SEL_entry']['Create_SEL'][1]} 0x${sensor_type} 0x${sensor_number}
+    ...  ${IPMI_RAW_CMD['SEL_entry']['Create_SEL'][2]}
+
+    ${resp}=  Run IPMI Command  ${cmd}
 
     Should Not Contain  ${resp}  00 00  msg=SEL not created.
 
diff --git a/lib/resource.robot b/lib/resource.robot
index 7bbda8c..947f3fe 100755
--- a/lib/resource.robot
+++ b/lib/resource.robot
@@ -58,6 +58,8 @@
 ${IPMI_CIPHER_LEVEL}  ${17}
 # IPMI timeout default.
 ${IPMI_TIMEOUT}       ${3}
+${GEN_ID_BYTE_1}  ${20}
+${GEN_ID_BYTE_2}  ${00}
 
 # Log default path for IPMI SOL.
 ${IPMI_SOL_LOG_FILE}    ${EXECDIR}${/}logs${/}sol_${OPENBMC_HOST}