summaryrefslogtreecommitdiff
path: root/test.sh
blob: 432128fd7c347eef7c5fc4acbb1257df092612f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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