sysklogd/test/remote.sh
Joachim Nilsson 512aaa1afc Fix paths for out-of-tree builds, found by make distcheck
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-11-04 20:09:54 +01:00

27 lines
468 B
Bash
Executable File

#!/bin/sh
set -ex
. ${srcdir}/test.rc
MSG="kilroy"
# Start collector in background, note: might need sudo!
tshark -Qni lo -w ${CAP} port ${PORT} &
PID="$!"
# Wait for tshark to start up properly
sleep 2
../src/logger -u ${SOCK} ${MSG}
# Wait for any OS delays, in particular on Travis
sleep 2
# Stop tshark collector
kill -TERM ${PID}
wait ${PID}
# Analyze content, should have $MSG now ...
tshark -d udp.port==${PORT},syslog -r ${CAP} | grep ${MSG}
rm ${CAP}