File: check-test-fullmode-with-stun.sh

package info (click to toggle)
libnice 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,840 kB
  • sloc: ansic: 19,186; sh: 11,071; makefile: 348
file content (30 lines) | stat: -rwxr-xr-x 534 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh

STUND=../stun/tools/stund

echo "Starting ICE full-mode with STUN unit test."

[ -e "$STUND" ] || {
	echo "STUN server not found: Cannot run unit test!" >&2
	exit 77
}

set -x
pidfile=./stund.pid

export NICE_STUN_SERVER=127.0.0.1
export NICE_STUN_SERVER_PORT=3800

echo "Launching stund on port ${NICE_STUN_SERVER_PORT}."

rm -f -- "$pidfile"
(sh -c "echo \$\$ > \"$pidfile\" && exec "$STUND" ${NICE_STUN_SERVER_PORT}") &
sleep 1

./test-fullmode
error=$?

kill "$(cat "$pidfile")"
rm -f -- "$pidfile"
wait
exit ${error}