summaryrefslogtreecommitdiff
path: root/test-all.sh
blob: 81ee66d6b6f6e35d2c190c93c9b86e6db7311844 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

export PATH=$PATH:/usr/local/bin

pkill -f udplogger_receiver
logger_dir=`mktemp -d /tmp/udplogger_test.XXXXXXXX`

if [ ! -d "${logger_dir}" ]; then
  echo "Couldn't create logger dir ${logger_dir}"
fi

logger_key="${logger_dir}/key.pem"
logger_crt="${logger_dir}/public.pem"

openssl genrsa -out "${logger_key}" 2048
openssl rsa -in "${logger_key}" -outform PEM -pubout -out "${logger_crt}"

ln -sf receiver udplogger_receiver
./udplogger_receiver -k "${logger_key}" "${logger_dir}" &

sleep 2

./sender -h localhost -p 58132 -c "${logger_crt}" "${logger_dir}"

pkill -f udplogger_receiver

grep -qri Juchu "${logger_dir}"

retval=$?

#if [ "${retval}" -eq 0 ]; then
#  echo "Found"
#fi

rm -r "${logger_dir}"

exit $retval