-
Notifications
You must be signed in to change notification settings - Fork 284
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
fe_test: add test for syslog feature #5985
Conversation
Where would we use this and what is the current pain point? |
there is a commented out stub for |
Okay, fixing the race, it's a problem with the test not ignoring logs from the daemon. Why it didn't happen before, I have no idea. |
I don't want to change a line of the code beside the test, that's why I used that method. |
What's "this" in your sentence ? Not clear what do you mean by pain point, are you asking me what's the importance of testing ? I suppose not. Not a rhetorical question, just I don't understand the question. That part of code was not tested so I'm adding a test. |
1be8754
to
3823110
Compare
Removed the race condition. |
ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to add a test for this.
@freddy77 there is a small conflict in the dune file. Could you update it?
The syslog feature allows to run a program and redirect its output/error stream to system log. It's triggered passing "syslog_stdout" argument to "Forkhelpers" functions like "execute_command_get_output". To test this feature use a small preload library to redirect syslog writing. This allows to test program without changing it. The log is redirected to /tmp/xyz instead of /dev/log. The name was chosen to allow for future static build redirection. The C program is used only for the test, so the code style take into account this (specifically it does not try to handle all redirect situation and all error paths). Signed-off-by: Frediano Ziglio <[email protected]>
@robhoes done |
The syslog feature allows to run a program and redirect its output/error stream to system log. It's triggered passing
syslog_stdout
argument toForkhelpers
functions likeexecute_command_get_output
.To test this feature use a small preload library to redirect syslog writing.
This allows to test program without changing it.
The log is redirected to
/tmp/xyz
instead of/dev/log
. The name was chosen to allow for future static build redirection.The C program is used only for the test, so the code style take into account this (specifically it does not try to handle all redirect situation and all error paths).