[syslog/test logrotate]: Fixed test_logrotate testcase failing due to incorrect logrotate threshold #9920
Closed
tudupa wants to merge 3 commits intosonic-net:masterfrom
Closed
[syslog/test logrotate]: Fixed test_logrotate testcase failing due to incorrect logrotate threshold #9920tudupa wants to merge 3 commits intosonic-net:masterfrom
tudupa wants to merge 3 commits intosonic-net:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
test_logrotate_normal_size testcase fails when the threshold for log rotation is different for different platforms. The threshold for logrotation is set in sonic-buildimage/files/image_config/logrotate/rsyslog.j2. Here the logrotate threshold is set based on the memory available in the platform. In the testcase this threshold was a constant and did not depend on the memory available in the platform.
How did you do it?
Added a function get_threshold_based_on_memory() to first check for the available memory in the platform and then set the logrotate threshold.
How did you verify/test it?
Ran both test_logrotate_normal_size() and test_logrotate_small_size() to see if the testcases passed.
Any platform specific information?
Supported testbed topology if it's a new test case?