Added tests for informational HOST error log
Change-Id: I4145dc6482565a2c67d6a9d96307702ee52dc3da
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/data/pel_variables.py b/data/pel_variables.py
index a3986f8..7a6cd51 100644
--- a/data/pel_variables.py
+++ b/data/pel_variables.py
@@ -39,3 +39,6 @@
CMD_UNRECOVERABLE_HOST_ERROR = ERROR_LOG_CREATE_BASE_CMD + 'xyz.openbmc_project.Host.Error.Event \
xyz.openbmc_project.Logging.Entry.Level.Error 1 RAWPEL /tmp/FILE_NBMC_UNRECOVERABLE'
+
+CMD_INFORMATIONAL_HOST_ERROR = ERROR_LOG_CREATE_BASE_CMD + 'xyz.openbmc_project.Host.Error.Event \
+ xyz.openbmc_project.Logging.Entry.Level.Error 1 RAWPEL /tmp/FILE_HOST_INFORMATIONAL'
diff --git a/openpower/pel/test_bmc_pel.robot b/openpower/pel/test_bmc_pel.robot
index 2c6b483..8d830f6 100644
--- a/openpower/pel/test_bmc_pel.robot
+++ b/openpower/pel/test_bmc_pel.robot
@@ -520,12 +520,16 @@
[Documentation] Verify error logging rotation policy for non bmc error logs.
[Tags] Verify_Error_Logging_Rotation_Policy_With_HOST_Error_Logs
[Setup] Run Keywords Open Connection for SCP AND scp.Put File ${UNRECOVERABLE_FILE_PATH}
- ... /tmp/FILE_NBMC_UNRECOVERABLE AND Redfish.Login
+ ... /tmp/FILE_HOST_UNRECOVERABLE AND scp.Put File ${INFORMATIONAL_FILE_PATH}
+ ... /tmp/FILE_HOST_INFORMATIONAL
[Template] Error Logging Rotation Policy
# Error logs to be created % of total logging space when error
# log exceeds max limit.
+ Informational HOST 3000 15
Unrecoverable HOST 3000 30
+ Informational HOST 1500, Informational BMC 1500 30
+ Informational HOST 1500, Unrecoverable BMC 1500 45
Unrecoverable HOST 1500, Informational BMC 1500 45
Unrecoverable HOST 1500, Predictive BMC 1500 60
@@ -695,7 +699,19 @@
${disk_usage_percentage}= Get Disk Usage For Error Logs
${percent_diff}= Evaluate ${disk_usage_percentage} - ${max_allocated_space_percentage}
${percent_diff}= Evaluate abs(${percent_diff})
- Should Be True ${percent_diff} <= 0.5
+
+ ${trimmed_as_expected}= Run Keyword If ${disk_usage_percentage} > ${max_allocated_space_percentage}
+ ... Evaluate ${percent_diff} <= 0.5
+ ... ELSE
+ ... Set Variable True
+
+ # Check PEL log count via peltool command and compare it with actual generated log count.
+ ${pel_records}= peltool -n
+ ${no_pel_records}= Set Variable ${pel_records["Number of PELs found"]}
+ # Number of logs can be 80% of the total logs created after trimming.
+ ${expected_max_record}= Evaluate 3000 * 0.8
+
+ Run Keyword If ${trimmed_as_expected} == False Should Be True ${no_pel_records} <= ${expected_max_record}
Create Error Log