-
Notifications
You must be signed in to change notification settings - Fork 285
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
base: master
Are you sure you want to change the base?
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. |
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]>
1be8754
to
3823110
Compare
Removed the race condition. |
ping |
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).