From f528b66a0ea74b306bed22d243495458c8cf2383 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Thu, 7 Jul 2016 19:46:47 -0400 Subject: Fix memory leaks, miscellaneous issues. --- test.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test.sh') diff --git a/test.sh b/test.sh index 842d530..a82020a 100755 --- a/test.sh +++ b/test.sh @@ -1,19 +1,21 @@ #!/bin/sh # this script tests basic udpastcp functionality. +: ${UDPASTCP:=./udpastcp} + test_bidi() { ( pids= - trap 'kill $pids' EXIT - ./udpastcp client "$1" 36563 "$1" 64109 & + trap 'kill $pids' INT TERM EXIT + $UDPASTCP client "$1" 36563 "$1" 64109 & pids="$!" - ./udpastcp server "$1" 64109 "$1" 41465 & + $UDPASTCP server "$1" 64109 "$1" 41465 & pids="$pids $!" - ( ( sleep 0.4; echo BBBBBBBB; ) | socat "udp-listen:41465,pf=${2}" - ) & + ( ( sleep 0.5; echo BBBBBBBB; ) | socat "udp-listen:41465,pf=${2}" - ) & pids="$pids $!" - ( ( sleep 0.2; echo AAAAAAAA; ) | socat - "udp-connect:localhost:36563,pf=${2}" ) & + ( ( sleep 0.4; echo AAAAAAAA; ) | socat - "udp-connect:localhost:36563,pf=${2}" ) & pids="$pids $!" - sleep 0.5 + sleep 0.6 ) } -- cgit v1.2.3-54-g00ecf