diff --git a/test/api.sh b/test/api.sh index 4c641e5..409b019 100755 --- a/test/api.sh +++ b/test/api.sh @@ -7,11 +7,11 @@ setup export MSG="no-openlog-apitest" -echo "= Phase 1 - simple syslog(), no openlog() ===============" +print "Phase 1 - simple syslog(), no openlog()" ./api grep "api: ${MSG}" ${LOG} -echo "= Phase 2 - syslog() with openlog() & custom facility ===" +print "Phase 2 - syslog() with openlog() & custom facility" cat <${CONFD}/console.conf console.* -${LOGCONS} EOF @@ -20,11 +20,12 @@ reload ./api -i foo grep "foo: ${MSG}" ${LOGCONS} -echo "= Phase 3 - Verify setlogmask() filters out LOG_INFO ====" +print "Phase 3 - Verify setlogmask() filters out LOG_INFO" ./api -i xyzzy -l -grep "xyzzy: ${MSG}" ${LOGCONS} || true +grep "xyzzy: ${MSG}" "${LOGCONS}" && FAIL "Filtering w/ setlogmask() broken" +echo "Filtering w/ setlogmask() Works fine" -echo "= Phase 4 - Verify RFC5424 API with syslogp() ===========" +print "Phase 4 - Verify RFC5424 API with syslogp()" cat <${CONFD}/v1.conf ftp.* -${LOGV1} ;RFC5424 EOF @@ -35,7 +36,9 @@ sleep 2 ps fax |grep -A2 syslogd grep "troglobit - MSGID - ${MSG}" ${LOGV1} || (echo "== ${LOGV1}"; tail -10 ${LOGV1}; echo "== ${LOG}"; tail -10 ${LOG}; cat ${CONFD}/v1.conf; FAIL "Cannot find troglobit") -echo "= Phase 4 - Verify RFC5424 API with logger(1) ===========" +print "Phase 4 - Verify RFC5424 API with logger(1)" ../src/logger -p ftp.notice -u ${SOCK} -m "MSDSD" -d '[exampleSDID@32473 iut="3" eventSource="Application" eventID="1011"]' "waldo" sleep 2 grep "exampleSDID@32473" ${LOGV1} || (echo "== ${LOGV1}"; tail -10 ${LOGV1}; FAIL "Cannot find exampleSDID@32473") + +OK diff --git a/test/fwd.sh b/test/fwd.sh index 421b3bb..0f8b8c3 100755 --- a/test/fwd.sh +++ b/test/fwd.sh @@ -23,8 +23,11 @@ EOF setup2 -m0 -a 127.0.0.2:* -b ":${PORT2}" +print "TEST: Starting" ../src/logger -t fwd -p ntp.notice -u ${SOCK} -m "NTP123" ${MSG} sleep 3 grep "fwd - NTP123 - ${MSG}" ${LOG2} || FAIL "Nothing forwarded." + +OK diff --git a/test/local.sh b/test/local.sh index 3942b8d..98c1cbb 100755 --- a/test/local.sh +++ b/test/local.sh @@ -5,6 +5,8 @@ fi . ${srcdir}/lib.sh setup +print "TEST: Starting" + MSG="foobar" MSG2="xyzzy" @@ -13,3 +15,4 @@ grep ${MSG} ${LOG} || FAIL "Cannot find: ${MSG}" ../src/logger -u ${ALTSOCK} ${MSG2} grep ${MSG2} ${LOG} || FAIL "Cannot find: ${MSG2}" +OK diff --git a/test/opts.sh b/test/opts.sh index 3c0f851..ae9f6c9 100755 --- a/test/opts.sh +++ b/test/opts.sh @@ -12,3 +12,5 @@ EOF setup -m0 >"${LOG2}" grep ';RFC5424,rotate=10000000:5' ${LOG2} || FAIL "Failed parsing RFC542 .conf" + +OK diff --git a/test/remote.sh b/test/remote.sh index 03cdbf8..194b595 100755 --- a/test/remote.sh +++ b/test/remote.sh @@ -18,6 +18,8 @@ cat <<-EOF >${CONFD2}/50-default.conf setup2 -m0 -a 127.0.0.2:* -b ":${PORT2}" +print "TEST: Starting" + # Start collector in background, note: might need sudo! #tshark -Qni lo -w ${CAP} port ${PORT} & tshark -Qni lo -w ${CAP} port 514 2>/dev/null & @@ -39,3 +41,5 @@ wait ${TPID} # Analyze content, should have $MSG now ... #tshark -d udp.port==${PORT},syslog -r ${CAP} | grep ${MSG} tshark -r ${CAP} 2>/dev/null | grep ${MSG} || FAIL "Cannot find: ${MSG}" + +OK