2019-11-03 20:24:36 +05:30
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
2019-11-05 00:39:54 +05:30
|
|
|
. ${srcdir}/test.rc
|
2019-11-03 20:24:36 +05:30
|
|
|
|
|
|
|
export MSG="no-openlog-apitest"
|
2019-11-04 00:21:39 +05:30
|
|
|
|
|
|
|
echo "= Phase 1 - simple syslog(), no openlog() ==============="
|
2019-11-03 20:24:36 +05:30
|
|
|
./api
|
|
|
|
grep "api ${MSG}" ${LOG}
|
2019-11-04 00:21:39 +05:30
|
|
|
|
|
|
|
echo "= Phase 2 - syslog() with openlog() & custom facility ==="
|
|
|
|
cat <<EOF >${CONFD}/bar.conf
|
|
|
|
console.* -${LOGCONS}
|
|
|
|
EOF
|
|
|
|
kill -HUP `cat ${PID}`
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
./api -i foo
|
|
|
|
grep "foo ${MSG}" ${LOGCONS}
|
|
|
|
|
|
|
|
echo "= Phase 3 - Verify setlogmask() filters out LOG_INFO ===="
|
|
|
|
./api -i xyzzy -l
|
|
|
|
grep "xyzzy ${MSG}" ${LOGCONS} || true
|
|
|
|
|
|
|
|
echo "= Phase 4 - Verify RFC5424 API with syslogp() ==========="
|
|
|
|
cat <<EOF >${CONFD}/v1.conf
|
|
|
|
ftp.* -${LOGV1} ;RFC5424
|
|
|
|
EOF
|
|
|
|
kill -HUP `cat ${PID}`
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
./api -i troglobit -p
|
|
|
|
grep "troglobit - MSGID - ${MSG}" ${LOGV1}
|
|
|
|
|