diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2016-07-01 23:14:09 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2016-07-01 23:14:09 -0400 |
commit | a93f1d79384c57c01a3ed7b64f0b373efd32ca05 (patch) | |
tree | 9ac662236e577460c5714f32c1192e6aed7c36f5 | |
parent | 79d98b1ea742f16f5c44b930c4ab940cd95b932f (diff) | |
download | udpastcp-a93f1d79384c57c01a3ed7b64f0b373efd32ca05.tar.xz udpastcp-a93f1d79384c57c01a3ed7b64f0b373efd32ca05.zip |
Add basic testing script.
-rwxr-xr-x | test.sh | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -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 |