8 # Dummy command line parsing tests
11 ! $STUNC server port dummy
14 ! $STUNC -4 127.0.0.1 1
17 # Allocate a likely unused port number
19 if test $PORT -le 1024; then
23 echo "Using local UDP port number $PORT ..."
25 # Start the STUN test daemon if needed
26 rm -f stund?.pid stund?.fail stunc?.log
29 (($SHELL -c "echo \$\$ > stund$v.pid ; exec $STUND -$v $PORT") || \
34 $STUNC -4 127.0.0.1 $PORT > stunc4.log ||
test -f stund4.fail
35 $STUNC -6 ::1 $PORT > stunc6.log ||
test -f stund6.fail
37 # Terminate the test daemon
38 for v
in 4 6; do kill -INT $
(cat stund
$v.pid
) || true
; done
41 # Check client results
42 if test -f stund4.fail
; then exit 77; fi
43 grep -e "^Mapped address: 127.0.0.1" stunc4.log ||
exit 4
45 if test -f stund6.fail
; then exit 77; fi
46 grep -e "^Mapped address: ::1" stunc6.log ||
exit 6
48 rm -f stund?.fail stund?.pid stunc?.log