sysklogd/test/opts.sh
Joachim Wiberg aad76ad03b test: refactor test.rc + start.sh + stop.sh -> lib.sh
Refactor test.rc, start.sh, and stop.sh into lib.sh that each test
sources and uses independently of each other.

More simplfication and cleanup needed.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-11-22 15:18:19 +01:00

19 lines
454 B
Bash
Executable File

#!/bin/sh
if [ x"${srcdir}" = x ]; then
srcdir=.
fi
. ${srcdir}/lib.sh
mkdir -p ${CONFD}
cat <<EOF > ${CONF}
# Match all log messages, store in RC5424 format and rotate every 10 MiB
*.* -${LOG} ;rotate=10M:5,RFC5424
EOF
../src/syslogd -m1 -b :${PORT} -d -sF -f ${CONF} -p ${SOCK} -p ${ALTSOCK} >${LOG2} &
echo "$!" > ${PID}
cat ${PID} >> "$DIR/PIDs"
sleep 2
grep ';RFC5424,rotate=10000000:5' ${LOG2} || FAIL "Failed parsing RFC542 .conf"