Skip to content

newsyslog: Add tests for rotating files based on size #1703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

bdesham
Copy link

@bdesham bdesham commented May 19, 2025

The tests for newsyslog(8) did not previously test size-based rotation, e.g., “rotate foo.log once it becomes larger than 8 KB.” This pull request adds a few tests for this functionality.

bdesham added 3 commits May 19, 2025 13:25
Previously, the run_newsyslog function always called newsyslog with the
"-F" flag, which tells it to trim log files even if the criteria haven't
been met. This was fine for the existing tests, but it meant that it
would be impossible to test the trimming process itself. Now, the -F
flag is used within individual tests as needed.

Signed-off-by: Benjamin Esham <[email protected]>
@bdesham bdesham force-pushed the newsyslog-tests branch from 518aa54 to 6b40d49 Compare May 19, 2025 19:55
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather not add additional steps to a pre-ATF test. Could you instead please write a new file, using atf-c, and put the tests in there?

@bdesham
Copy link
Author

bdesham commented May 29, 2025

@asomers I’m happy to revise this, but I’m not very familiar with FreeBSD’s testing infrastructure. Are you requesting that I rewrite the tests in C specifically? I would feel a lot more comfortable rewriting them as an ATF shell script (like usr.sbin/sysrc/tests/sysrc_test.sh, just to pick a concrete example).

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.

2 participants