rsyslog/tests/glbl-umask.sh
Kasumi Hanazuki 2ea7d7eef1 tests/glbl-umask.sh: Improve test stability
This patch improves the stability of tests/glbl-umask.sh, which now fails
when running after tests/rawmsg-after-pri.sh, since the glob pattern rsyslog.o*
matches rsyslog.out.compare, created by rawmsg-after-pri.sh.
2018-03-09 14:12:59 +09:00

30 lines
895 B
Bash
Executable File

#!/bin/bash
# addd 2017-03-06 by RGerhards, released under ASL 2.0
# Note: we need to inject a somewhat larger nubmer of messages in order
# to ensure that we receive some messages in the actual output file,
# as batching can (validly) cause a larger loss in the non-writable
# file
. $srcdir/diag.sh init
. $srcdir/diag.sh generate-conf
. $srcdir/diag.sh add-conf '
global(umask="0077")
template(name="outfmt" type="string" string="%msg:F,58:2%\n")
:msg, contains, "msgnum:" {
action(type="omfile" template="outfmt" file="rsyslog.out.log")
}
'
. $srcdir/diag.sh startup
$srcdir/diag.sh injectmsg 0 1
. $srcdir/diag.sh shutdown-when-empty
. $srcdir/diag.sh wait-shutdown
if [ `ls -l rsyslog.out.log|$RS_HEADCMD -c 10 ` != "-rw-------" ]; then
echo "invalid file permission (umask), rsyslog.out.log has:"
ls -l rsyslog.out.log
. $srcdir/diag.sh error-exit 1
fi;
. $srcdir/diag.sh exit