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

package info (click to toggle)
libnice 0.1.16-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,572 kB
  • sloc: ansic: 35,444; sh: 4,728; makefile: 523; xml: 113; python: 28
file content (36 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download
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
31
32
33
34
35
36
#! /bin/sh

if test -n "${BUILT_WITH_MESON}"; then
  STUND=$1
  TEST_FULLMODE=$2
else
  STUND=../stun/tools/stund
  TEST_FULLMODE=./test-fullmode
fi

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}