Skip to contentSkip to conversation

question about logger tests

DISCUSSION Ruediger Meier 2 participants 5 messages Mar 26, 2015 – Apr 9, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

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

maintainer
#1 lore raw
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.

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/log at 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
#2 lore raw
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/log at 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.

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

maintainer
#3 lore raw
Quoted 1 line · Ruediger Meier

So how could we skip logger tests safely if /dev/log does 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
#4 lore raw
Quoted 8 lines · Karel Zak
Quoted 1 line · Ruediger Meier

So how could we skip logger tests safely if /dev/log does 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