#/bin/bash
# Test configuration parser.
. common.sh
set +o errexit

$HITCH --test --config=configs/default.cfg certs/default.example.com 2>/dev/null 1>&2
test "$?" = "0" || die "default.cfg is not testable."

$HITCH --test --config=configs/test08a.cfg certs/default.example.com 2>/dev/null 1>&2
test "$?" = "1" || die "Invalid config test08a.cfg parsed correctly."

$HITCH --test --config=configs/test08b.cfg certs/default.example.com 2>/dev/null
test "$?" = "1" || die "Invalid config test08b.cfg parsed correctly."

$HITCH --test --config=configs/test08c.cfg certs/default.example.com 2>/dev/null
test "$?" = "0" || die "Valid config test08c.cfg unparseable?"

$HITCH --test --config=configs/test08d.cfg certs/default.example.com 2>/dev/null 1>&2
test "$?" = "0" || die "Valid config test08d.cfg unparseable?"

