summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
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
)
}