#!/bin/sh

retval=0

NSLINT=${NSLINT:-nslint}

cd $(dirname $0)
if (cd bind; $NSLINT -c named.conf) ; then
  echo success: no error in zone detected
else
  echo failure: error in supposed correct zone detected
  retval=1
fi

if (cd bind-broken; $NSLINT -c named.conf) 2>&1 ; then
  echo error: no error in supposed incorrect zone detected.
  retval=1
else
  echo success: error in zone detected.
fi

exit $retval
