#!/bin/sh
# This regression test is a part of SIPp.
# Author: Walter Doekes, OSSO B.V., 2015
. "`dirname "$0"`/../functions"; init

skip "will fix later"

# Valgrind on UAS.
valgrind --xml=yes --xml-file=uas.log --partial-loads-ok=yes \
    --show-leak-kinds=all --leak-check=full `get_sipp` -nostdin -m 10 -sn uas \
    >/dev/null 2>&1 &
uaspid=$!
sleep 1

# Valgrind on UAC.
valgrind --xml=yes --xml-file=uac.log --partial-loads-ok=yes \
    --show-leak-kinds=all --leak-check=full `get_sipp` -nostdin -m 10 -sn uac \
    127.0.0.1 >/dev/null 2>&1 &
uacpid=$!

wait $uaspid
test $? -ne 0 && fail "UAS returned non-zero"

wait $uacpid
test $? -ne 0 && fail "UAC returned non-zero"

grep -q '<error>' uas.log && fail "valgrind reported leaks in UAS"
grep -q '<error>' uac.log && fail "valgrind reported leaks in UAC"

ok
