2019-11-03 20:24:36 +05:30
|
|
|
#!/bin/sh
|
2019-11-06 20:37:13 +05:30
|
|
|
set -ex
|
2019-11-07 23:28:25 +05:30
|
|
|
if [ x"${srcdir}" = x ]; then
|
|
|
|
srcdir=.
|
|
|
|
fi
|
2019-11-07 23:43:28 +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
|
2019-11-06 21:08:30 +05:30
|
|
|
sleep 2
|
|
|
|
ps fax |grep -A2 syslogd
|
2019-11-06 20:56:44 +05:30
|
|
|
grep "troglobit - MSGID - ${MSG}" ${LOGV1} || (echo "== ${LOGV1}"; tail -10 ${LOGV1}; echo "== ${LOG}"; tail -10 ${LOG}; cat ${CONFD}/v1.conf; false)
|
2019-11-04 00:21:39 +05:30
|
|
|
|