diff options
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 ) } |