#!/bin/sh
# This regression test is a part of SIPp.
# An <init> label without an id is a load error, as a label elsewhere
# is, rather than a crash. The scenario is made here, as it does not
# validate against sipp.dtd.
. "`dirname "$0"`/../functions"; init

cat >uac-no-id.xml <<'XML'
<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="init label without an id">
  <init>
    <label />
  </init>
  <nop />
</scenario>
XML
out=`sippfg -sf uac-no-id.xml -i 127.0.0.1 -p 25881 -m 1 127.0.0.1:25880 \
    -timeout 2 2>&1`
status=$?
rm -f uac-no-id.xml

if test $status -ne 255; then
    fail "exit status $status, not 255"
elif ! echo "$out" | grep -q "label is missing the required 'id' parameter"; then
    fail "no load error"
else
    ok
fi
