Error injection through OS related automation [stage 4]

Enable following scenarios
1. Keyword to disable cpu states through HOST.
2. CoreFIR - RECV 1, RECV 5, RECV 32 error injections.
3. EQFIR - RECV32 error injection.
4. NCU - UE error injection.

Resolves openbmc/openbmc-test-automation#1135

Change-Id: Ifbd54f2b858a2fccf75d430c558a671248f99067
Signed-off-by: Sridevi Ramesh <sridevra@in.ibm.com>
diff --git a/lib/ras/host_utils.robot b/lib/ras/host_utils.robot
index 4e4efdd..9ab425e 100644
--- a/lib/ras/host_utils.robot
+++ b/lib/ras/host_utils.robot
@@ -5,6 +5,8 @@
 Variables           ../../lib/ras/variables.py
 Library             ../../lib/bmc_ssh_utils.py
 Library             OperatingSystem
+Library             ../../lib/gen_print.py
+Library             ../../lib/gen_robot_print.py
 
 *** Keywords ***
 
@@ -17,7 +19,6 @@
     #                -c|--chip <chip-id> <addr>
 
     ${output}  ${stderr}  ${rc}=  OS Execute Command  getscom ${input_cmd}
-    Should Be Empty  ${stderr}
     [Return]  ${output}
 
 Gard Operations On OS
@@ -28,7 +29,6 @@
     # input_cmd      list/clear all/show <gard_record_id>
 
     ${output}  ${stderr}  ${rc}=  OS Execute Command  opal-gard ${input_cmd}
-    Should Be Empty  ${stderr}
     [Return]  ${output}
 
 Putscom Operations On OS
@@ -75,7 +75,6 @@
     ${cmd}=  Catenate  set -o pipefail ; ${probe_cpu_file_path}
     ...    | grep -i 'CHIP ID: ${proc_chip_id}' | cut -c21-22
     ${output}  ${stderr}  ${rc}=  OS Execute Command  ${cmd}
-    Should Be Empty  ${stderr}
     ${core_ids}=  Split String  ${output}
     # Example output:
     # ['2', '3', '4', '5', '6']
@@ -93,7 +92,6 @@
     ${cmd}=  Catenate  set -o pipefail ; ${addr_translation_file_path} ${fir}
     ...  ${core_id} | grep -i ${target_type}
     ${output}  ${stderr}  ${rc}=  OS Execute Command  ${cmd}
-    Should Be Empty  ${stderr}
     ${translated_addr}=  Split String  ${output}  :${SPACE}0x
     # Example output:
     # 0x10010c00
@@ -134,3 +132,10 @@
     ...   host during PNOR code update.
 
     Inject Error Through HOST  05010800  4000000000000000  1
+
+Disable CPU States Through HOST
+    [Documentation]  Disable CPU states through host.
+
+    ${cmd}=  Catenate  SEPARATOR=  for file_path in /sys/devices/system/cpu/
+    ...  cpu*/cpuidle/state*/disable; do echo 0 > $file_path; done
+    ${output}  ${stderr}  ${rc}=  OS Execute Command  ${cmd}
diff --git a/lib/ras/variables.py b/lib/ras/variables.py
index 0964259..a67804b 100644
--- a/lib/ras/variables.py
+++ b/lib/ras/variables.py
@@ -35,6 +35,11 @@
 DES_CME_RECV1 = "'CMEFIR[^7].*PPE SRAM Uncorrectable Err'"
 DES_EQ_RECV32 = "'EQ_LFIR[^1].*CFIR internal parity'"
 DES_NCU_RECV1 = "'NCUFIR[^8].*NCU Store Queue Data'"
+DES_NCU_UE = "'NCUFIR[^0].*NCU store queue control'"
+
+DES_CORE_RECV5 = "'COREFIR[^0].*IFU SRAM Recoverable err'"
+DES_CORE_RECV1 = "'COREFIR[^30].*LSU Set Delete Err'"
+DES_CORE_UE = "'COREFIR[^1].*TC Checkstop'"
 
 # The following is an error injection dictionary with each entry consisting of:
 # - field_name: Targettype_threshold_limit .
@@ -68,6 +73,10 @@
              'CMEFIR_RECV1': ['10012000', '0100000000000000', DES_CME_RECV1],
              'EQFIR_RECV32': ['1004000A', '8000000000000000', DES_EQ_RECV32],
              'NCUFIR_RECV1': ['10011400', '0080000000000000', DES_NCU_RECV1],
+             'NCUFIR_UE': ['10011400', '8000000000000000', DES_NCU_UE],
+             'COREFIR_RECV5': ['20010A40', '8000000000000000', DES_CORE_RECV5],
+             'COREFIR_RECV1': ['20010A40', '0000000200000000', DES_CORE_RECV1],
+             'COREFIR_UE': ['20010A40', '4000000000000000', DES_CORE_UE],
 
              }