Fix #39: update tests to use -P fn and -C fn

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg 2021-06-30 23:00:09 +02:00
parent e381bc3620
commit 9ce3c2e8ec
5 changed files with 12 additions and 9 deletions

View File

@ -9,16 +9,16 @@ fi
MSG="fwd and allow"
cat <<EOF >${CONFD}/fwd.conf
ntp.* @127.0.0.2:${PORT2} ;RFC5424
kern.* /dev/null
ntp.* @127.0.0.2:${PORT2} ;RFC5424
EOF
cat <<EOF >${CONFD2}/50-default.conf
kern.* /dev/null
*.*;kern.none ${LOG2} ;RFC5424
*.*;kern.none ${LOG2} ;RFC5424
EOF
../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 &
echo "$!" > ${PID2}
../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 -C ${CACHE2} -P ${PID2} &
kill -HUP `cat ${PID}`
sleep 2

View File

@ -10,7 +10,7 @@ MSG="kilroy"
# Start collector in background, note: might need sudo!
#tshark -Qni lo -w ${CAP} port ${PORT} &
tshark -Qni lo -w ${CAP} port 514 &
PID="$!"
TPID="$!"
# Wait for tshark to start up properly
sleep 3
@ -21,8 +21,8 @@ sleep 3
sleep 1
# Stop tshark collector
kill -TERM ${PID}
wait ${PID}
kill -TERM ${TPID}
wait ${TPID}
# Analyze content, should have $MSG now ...
#tshark -d udp.port==${PORT},syslog -r ${CAP} | grep ${MSG}

View File

@ -26,8 +26,7 @@ cat <<EOF > ${CONFD}/bar.conf
*.* @127.0.0.2
EOF
../src/syslogd -m1 -b :${PORT} -d -sF -f ${CONF} -p ${SOCK} -p ${ALTSOCK} &
echo "$!" > ${PID}
../src/syslogd -m1 -b :${PORT} -d -sF -f ${CONF} -p ${SOCK} -p ${ALTSOCK} -C ${CACHE} -P ${PID} &
sleep 2
kill -USR1 `cat ${PID}`

View File

@ -23,6 +23,8 @@ rm -f ${PID}
rm -f ${PID2}
rm -f ${CAP}
rm -f ${SOCK}
rm -f ${CACHE}
rm -f ${CACHE2}
rm -f ${CONF}
rm -f ${CONF2}
rm -rf ${CONFD}

View File

@ -7,6 +7,8 @@ LOGCONS=/tmp/${NM}-cons.log
PID=/tmp/${NM}.pid
PID2=/tmp/${NM2}.pid
CAP=/tmp/${NM}.pcapng
CACHE=/tmp/${NM}.cache
CACHE2=/tmp/${NM2}.cache
CONF=/tmp/${NM}.conf
CONF2=/tmp/${NM2}.conf
CONFD=/tmp/${NM}.d