diff options
-rwxr-xr-x | test-all.sh | 37 |
1 files changed, 37 insertions, 0 deletions
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 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | export PATH=$PATH:/usr/local/bin | ||
4 | |||
5 | pkill -f udplogger_receiver | ||
6 | logger_dir=`mktemp -d /tmp/udplogger_test.XXXXXXXX` | ||
7 | |||
8 | if [ ! -d "${logger_dir}" ]; then | ||
9 | echo "Couldn't create logger dir ${logger_dir}" | ||
10 | fi | ||
11 | |||
12 | logger_key="${logger_dir}/key.pem" | ||
13 | logger_crt="${logger_dir}/public.pem" | ||
14 | |||
15 | openssl genrsa -out "${logger_key}" 2048 | ||
16 | openssl rsa -in "${logger_key}" -outform PEM -pubout -out "${logger_crt}" | ||
17 | |||
18 | ln -sf receiver udplogger_receiver | ||
19 | ./udplogger_receiver -k "${logger_key}" "${logger_dir}" & | ||
20 | |||
21 | sleep 2 | ||
22 | |||
23 | ./sender -h localhost -p 58132 -c "${logger_crt}" "${logger_dir}" | ||
24 | |||
25 | pkill -f udplogger_receiver | ||
26 | |||
27 | grep -qri Juchu "${logger_dir}" | ||
28 | |||
29 | retval=$? | ||
30 | |||
31 | #if [ "${retval}" -eq 0 ]; then | ||
32 | # echo "Found" | ||
33 | #fi | ||
34 | |||
35 | rm -r "${logger_dir}" | ||
36 | |||
37 | exit $retval | ||