summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2016-07-07 19:46:47 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2016-07-07 19:46:47 -0400
commitf528b66a0ea74b306bed22d243495458c8cf2383 (patch)
tree8f29e25b83ca88529da26e8b9e0e988005357f4a /test.sh
parent03bdee772197c600b0066ebd1f27172332045da2 (diff)
downloadudpastcp-f528b66a0ea74b306bed22d243495458c8cf2383.tar.xz
udpastcp-f528b66a0ea74b306bed22d243495458c8cf2383.zip
Fix memory leaks, miscellaneous issues.
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh14
1 files changed, 8 insertions, 6 deletions
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
)
}