question about logger tests
Hi,
Our logger tests fail if it can't connect to /dev/log. I'd like to fix that case for the test-suite but have some questions:
1. It was confusing for me to figure out the actual problem. Maybe --no-act and/or --stderr should imply that --socket-errors=auto turns error printing on?
2. Alternatively we could use --socket-errors=on for all tests.
3. Couldn't we fix --no-act to not need an open /dev/log at all?
cu,
Rudi
Karel Zak
maintainerQuoted 6 lines · Ruediger Meier
Our logger tests fail if it can't connect to
/dev/log. I'd like to fix that case for the test-suite but have some questions:1. It was confusing for me to figure out the actual problem. Maybe --no-act and/or --stderr should imply that --socket-errors=auto turns error printing on?
Hmm.. probably good idea.
Quoted 3 lines
2. Alternatively we could use --socket-errors=on for all tests.
3. Couldn't we fix --no-act to not need an open
/dev/logat all?
But then it will introduce another fragility, complexity and difference between test (--no-act) and non-test mode. I see for example "if(ctl->fd < 0)" in code. Now it really skips write() only.
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 9 lines · Karel Zak
Quoted 6 lines · Ruediger Meier
Our logger tests fail if it can't connect to
/dev/log. I'd like to fix that case for the test-suite but have some questions:1. It was confusing for me to figure out the actual problem. Maybe --no-act and/or --stderr should imply that --socket-errors=auto turns error printing on?
Hmm.. probably good idea.
I'll send a patch.
Quoted 7 lines
Quoted 3 lines
2. Alternatively we could use --socket-errors=on for all tests.
3. Couldn't we fix --no-act to not need an open
/dev/logat all?But then it will introduce another fragility, complexity and difference between test (--no-act) and non-test mode. I see for example "
if(ctl->fd < 0)" in code. Now it really skipswrite()only.
You are right. If there would be a real-life use case for --no-act then not connecting /dev/log could be an optimization but I guess there is no such use case except our tests.
So how could we skip logger tests safely if /dev/log does not work?
cu,
Rudi
Karel Zak
maintainerQuoted 1 line · Ruediger Meier
So how could we skip logger tests safely if
/dev/logdoes not work?
Would be enough to test by
socat - UNIX-CONNECT:/dev/log
connect to the socket?
Karel
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Quoted 8 lines · Karel Zak
Quoted 1 line · Ruediger Meier
So how could we skip logger tests safely if
/dev/logdoes not work?Would be enough to test by
socat - UNIX-CONNECT:/dev/log
connect to the socket?
Well, using socat we can also use another socat listening socket instead of /dev/log at all. BTW we wouldn't even need --stderr and --no-act to check the written data.
I have done this in my github clone, branch "tests-logger"
https://github.com/rudimeier/util-linux/commits/tests-logger
(Not ready for merge yet.)
cu,
Rudi