From a93f1d79384c57c01a3ed7b64f0b373efd32ca05 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Fri, 1 Jul 2016 23:14:09 -0400 Subject: Add basic testing script. --- test.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 test.sh diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..432128f --- /dev/null +++ b/test.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# this script tests basic udpastcp functionality. +if ( +pids= +trap 'kill $pids' EXIT +./udpastcp client localhost 36563 localhost 64109 & +pids="$!" +./udpastcp server localhost 64109 localhost 41465 & +pids+=" $!" +socat udp6-listen:41465 - & +pids+=" $!" +( sleep 1; echo AAAAAAAA | socat - 'udp-connect:[::1]:36563' ) & +pids+=" $!" +sleep 2 +) 2>/dev/null | grep AAAAAAAA >/dev/null; then + echo "Test succeeded." +else + echo "Test failed." + exit 1 +fi -- cgit v1.2.3-70-g09d2