2019-11-14 01:20:42 +01:00
|
|
|
#!/bin/sh
|
2019-12-01 21:12:02 +01:00
|
|
|
# Test FWD between two syslogd, second binds 127.0.0.2:5555
|
2021-11-22 11:22:04 +01:00
|
|
|
if [ x"${srcdir}" = x ]; then
|
|
|
|
srcdir=.
|
|
|
|
fi
|
2021-11-22 15:16:05 +01:00
|
|
|
. ${srcdir}/lib.sh
|
|
|
|
|
2022-03-06 00:56:03 +01:00
|
|
|
setup -m0
|
2019-11-14 01:20:42 +01:00
|
|
|
|
2019-11-15 11:07:15 +01:00
|
|
|
MSG="fwd and allow"
|
2019-11-14 01:20:42 +01:00
|
|
|
|
2022-03-06 01:06:38 +01:00
|
|
|
cat <<EOF >"${CONFD}/fwd.conf"
|
2021-06-30 23:00:09 +02:00
|
|
|
kern.* /dev/null
|
|
|
|
ntp.* @127.0.0.2:${PORT2} ;RFC5424
|
2019-11-14 01:20:42 +01:00
|
|
|
EOF
|
|
|
|
|
2022-03-06 00:56:03 +01:00
|
|
|
reload
|
|
|
|
|
2022-03-06 01:06:38 +01:00
|
|
|
cat <<EOF >"${CONFD2}/50-default.conf"
|
2021-01-15 09:40:31 +01:00
|
|
|
kern.* /dev/null
|
2021-06-30 23:00:09 +02:00
|
|
|
*.*;kern.none ${LOG2} ;RFC5424
|
2019-11-14 01:20:42 +01:00
|
|
|
EOF
|
|
|
|
|
2022-03-06 00:56:03 +01:00
|
|
|
setup2 -m0 -a 127.0.0.2:* -b ":${PORT2}"
|
2019-11-14 01:20:42 +01:00
|
|
|
|
2022-03-06 01:02:03 +01:00
|
|
|
print "TEST: Starting"
|
2019-11-14 01:20:42 +01:00
|
|
|
|
2022-03-06 01:06:38 +01:00
|
|
|
../src/logger -t fwd -p ntp.notice -u "${SOCK}" -m "NTP123" "${MSG}"
|
2022-03-06 01:07:31 +01:00
|
|
|
sleep 3 # Allow message to be received, processed, and forwarded
|
2022-03-06 01:06:38 +01:00
|
|
|
grep "fwd - NTP123 - ${MSG}" "${LOG2}" || FAIL "Nothing forwarded."
|
2022-03-06 01:02:03 +01:00
|
|
|
|
|
|
|
OK
|