diff --git a/test/Makefile.am b/test/Makefile.am index 4447d8b..6278473 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,5 +1,5 @@ EXTRA_DIST = test.rc start.sh stop.sh -EXTRA_DIST += api.sh local.sh remote.sh fwd.sh +EXTRA_DIST += api.sh local.sh remote.sh fwd.sh mark.sh CLEANFILES = *~ *.trs *.log TEST_EXTENSIONS = .sh @@ -14,6 +14,7 @@ TESTS += local.sh TESTS += remote.sh TESTS += api.sh TESTS += fwd.sh +TESTS += mark.sh TESTS += stop.sh programs: $(check_PROGRAMS) diff --git a/test/fwd.sh b/test/fwd.sh index 25d3342..31c568f 100755 --- a/test/fwd.sh +++ b/test/fwd.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Test FWD between two syslogd, second binds 127.0.0.2:4444 +# Test FWD between two syslogd, second binds 127.0.0.2:5555 set -ex if [ x"${srcdir}" = x ]; then srcdir=. @@ -16,7 +16,7 @@ cat <${CONFD2}/50-default.conf *.* ${LOG2} ;RFC5424 EOF -../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} & +../src/syslogd -a 127.0.0.2:* -b :${PORT2} -d -F -f ${CONF2} -p ${SOCK2} -m1 & echo "$!" > ${PID2} kill -HUP `cat ${PID}` diff --git a/test/mark.sh b/test/mark.sh new file mode 100755 index 0000000..bf25c3a --- /dev/null +++ b/test/mark.sh @@ -0,0 +1,10 @@ +#!/bin/sh -e +# Test '-- MARK --' in log, depends on fwd.sh + +if [ x"${srcdir}" = x ]; then + srcdir=. +fi +. ${srcdir}/test.rc + +sleep 60 +grep "MARK" ${LOG2} diff --git a/test/start.sh b/test/start.sh index 2cdf38b..bbb4ac5 100755 --- a/test/start.sh +++ b/test/start.sh @@ -26,7 +26,7 @@ cat < ${CONFD}/bar.conf *.* @127.0.0.2 EOF -../src/syslogd -b :${PORT} -d -sF -f ${CONF} -p ${SOCK} -p ${ALTSOCK} & +../src/syslogd -m1 -b :${PORT} -d -sF -f ${CONF} -p ${SOCK} -p ${ALTSOCK} & echo "$!" > ${PID} sleep 2 diff --git a/test/stop.sh b/test/stop.sh index 95579ca..1b74f50 100755 --- a/test/stop.sh +++ b/test/stop.sh @@ -6,12 +6,18 @@ fi . ${srcdir}/test.rc if [ -e ${PID} ]; then - echo "Killing `cat ${PID}` ..." + echo "Killing 1st syslogd, PID:`cat ${PID}` ..." kill `cat ${PID}` fi +if [ -e ${PID2} ]; then + echo "Killing 2nd syslogd, PID:`cat ${PID2}` ..." + kill `cat ${PID2}` +fi + rm -f ${LOG} rm -f ${LOGV1} +rm -f ${LOG2} rm -f ${LOGCONS} rm -f ${PID} rm -f ${CAP}