sysklogd/test/fwd.sh
Joachim Wiberg f29f31340c test: refactor and generalize setup(), adding a setup2()
This patch refactors the way the primary and secondary syslogd is
started by the test framework.  The generalizations not only make the
code more readable, it hopefully also makes it easier to add new tests
in the future.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2022-03-06 00:56:03 +01:00

31 lines
540 B
Bash
Executable File

#!/bin/sh
# Test FWD between two syslogd, second binds 127.0.0.2:5555
if [ x"${srcdir}" = x ]; then
srcdir=.
fi
. ${srcdir}/lib.sh
setup -m0
MSG="fwd and allow"
cat <<EOF >${CONFD}/fwd.conf
kern.* /dev/null
ntp.* @127.0.0.2:${PORT2} ;RFC5424
EOF
reload
cat <<EOF >${CONFD2}/50-default.conf
kern.* /dev/null
*.*;kern.none ${LOG2} ;RFC5424
EOF
setup2 -m0 -a 127.0.0.2:* -b ":${PORT2}"
../src/logger -t fwd -p ntp.notice -u ${SOCK} -m "NTP123" ${MSG}
sleep 3
grep "fwd - NTP123 - ${MSG}" ${LOG2} || FAIL "Nothing forwarded."