Skip to content

[syslog/test logrotate]: Fixed test_logrotate testcase failing due to incorrect logrotate threshold #9920

Closed
tudupa wants to merge 3 commits intosonic-net:masterfrom
tudupa:syslog/test_logrotate
Closed

[syslog/test logrotate]: Fixed test_logrotate testcase failing due to incorrect logrotate threshold #9920
tudupa wants to merge 3 commits intosonic-net:masterfrom
tudupa:syslog/test_logrotate

Conversation

@tudupa
Copy link
Copy Markdown
Contributor

@tudupa tudupa commented Sep 8, 2023

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

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?

@tudupa tudupa closed this Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant