test: Check sending log messages to remote server works

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2019-10-30 17:14:29 +01:00
parent 72bbee7812
commit 8f459d349a
7 changed files with 38 additions and 9 deletions

22
test/remote.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -x
. ./test.rc
MSG="kilroy"
tshark -Qni lo -w ${CAP} port ${PORT} 2>/dev/null &
#tcpdump -qlni lo -w ${CAP} port ${PORT} 2>/dev/null &
PID="$!"
sleep 1
echo "Hej"
../src/logger -u ${SOCK} ${MSG}
echo "Nej"
sleep 1
kill -TERM ${PID}
wait ${PID}
tshark -d udp.port==${PORT},syslog -r ${CAP} | grep ${MSG}
rm ${CAP}