From 9ce3c2e8ec47e8de2a1afb874b0fb79ad79a736d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 30 Jun 2021 23:00:09 +0200 Subject: [PATCH] Fix #39: update tests to use -P fn and -C fn Signed-off-by: Joachim Wiberg --- test/fwd.sh | 8 ++++---- test/remote.sh | 6 +++--- test/start.sh | 3 +-- test/stop.sh | 2 ++ test/test.rc | 2 ++ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/fwd.sh b/test/fwd.sh index 6410684..3fadbce 100755 --- a/test/fwd.sh +++ b/test/fwd.sh @@ -9,16 +9,16 @@ fi MSG="fwd and allow" cat <${CONFD}/fwd.conf -ntp.* @127.0.0.2:${PORT2} ;RFC5424 +kern.* /dev/null +ntp.* @127.0.0.2:${PORT2} ;RFC5424 EOF cat <${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 diff --git a/test/remote.sh b/test/remote.sh index a281460..7f14ab8 100755 --- a/test/remote.sh +++ b/test/remote.sh @@ -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} diff --git a/test/start.sh b/test/start.sh index bbb4ac5..295ad4f 100755 --- a/test/start.sh +++ b/test/start.sh @@ -26,8 +26,7 @@ cat < ${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}` diff --git a/test/stop.sh b/test/stop.sh index ac6d16e..8982892 100755 --- a/test/stop.sh +++ b/test/stop.sh @@ -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} diff --git a/test/test.rc b/test/test.rc index 532f6ae..dff079c 100644 --- a/test/test.rc +++ b/test/test.rc @@ -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