From 96f643602fde2bd3a9c759fe37d9f2ed50c218b0 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Mon, 18 Jan 2021 18:01:28 +0100 Subject: Add testing script --- test-all.sh | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 test-all.sh (limited to 'test-all.sh') diff --git a/test-all.sh b/test-all.sh new file mode 100755 index 0000000..81ee66d --- /dev/null +++ b/test-all.sh @@ -0,0 +1,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 -- cgit v1.2.3