Add testcase to verify max informational error log
Added test case:
- Verify Informational Error Log Size When Error Log Exceeds Limit
Change-Id: Icba1d0d3d716a63390aa96f1940965d614679e1c
Signed-off-by: manashsarma <manashsarma@in.ibm.com>
diff --git a/openpower/pel/test_bmc_pel.robot b/openpower/pel/test_bmc_pel.robot
index 8585c30..f1765c6 100644
--- a/openpower/pel/test_bmc_pel.robot
+++ b/openpower/pel/test_bmc_pel.robot
@@ -43,6 +43,8 @@
@{mandatory_pel_fileds} Private Header User Header Primary SRC Extended User Header Failing MTMS
+${info_log_max_usage_percentage} 15
+
*** Test Cases ***
@@ -518,8 +520,46 @@
Should Contain ${pel_records['${id}']['Sev']} Unrecoverable
+Verify Informational Error Log Size When Error Log Exceeds Limit
+ [Documentation] Verify informational error log size when informational log size exceeds limit.
+ [Tags] Verify_Informational_Error_Log_Error_Log_When_Size_Exceeds_Limit
+
+ # Initially remove all logs.
+ Redfish Purge Event Log
+
+ # Create 3001 information logs.
+ FOR ${LOG_COUNT} IN RANGE 0 3001
+ BMC Execute Command ${CMD_INFORMATIONAL_ERROR}
+ END
+
+ # Delay for BMC to perform log compression when log size exceeds.
+ Sleep 10s
+
+ # Check logsize and verify that disk usage is around 15%.
+ ${usage_percent}= Get Disk Usage For Error Logs
+ ${percent_diff}= Evaluate ${usage_percent} - ${info_log_max_usage_percentage}
+ ${percent_diff}= Evaluate abs(${percent_diff})
+ Should Be True ${percent_diff} <= 0.5
+
+
*** Keywords ***
+Get Disk Usage For Error Logs
+ [Documentation] Get disk usage percentage for error logs.
+
+ ${usage_output} ${stderr} ${rc}= BMC Execute Command du /var/lib/phosphor-logging/errors
+
+ ${usage_output}= Fetch From Left ${usage_output} \/
+
+ # Covert disk usage unit from KB to MB.
+ ${usage_output}= Evaluate ${usage_output} / 1024
+
+ # Logging disk capacity limit is set to 20MB. So calculating the log usage percentage.
+ ${usage_percent}= Evaluate ${usage_output} / 20 * 100
+
+ [return] ${usage_percent}
+
+
Create Test PEL Log
[Documentation] Generate test PEL log.
[Arguments] ${pel_type}=Internal Failure