sysklogd/test/remote.sh
Joachim Nilsson c6a19049dc Trim remote test, restore startup/log sleep 2
Even on my laptop it sometimes takes a bit too long for tshark to start
up and syslogd to actually FWD the $MSG to remote.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
2019-10-31 12:07:52 +01:00

27 lines
460 B
Bash
Executable File

#!/bin/sh
set -ex
. ./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}