5832599943147268f9a4383d3dde39f8489bf339Evan Hunt#!/bin/sh
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt#
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt#
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# This Source Code Form is subject to the terms of the Mozilla Public
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# License, v. 2.0. If a copy of the MPL was not distributed with this
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# $Id$
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan HuntSYSTEMTESTTOP=..
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt. $SYSTEMTESTTOP/conf.sh
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Huntstatus=0
5832599943147268f9a4383d3dde39f8489bf339Evan Huntn=0
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Huntrm -f dig.out.*
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan HuntDIGOPTS="+tcp +noau +noadd +nosea +nostat +nocmd +dnssec -p 5300"
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# Check the example. domain
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Huntecho "I:checking that positive validation works ($n)"
5832599943147268f9a4383d3dde39f8489bf339Evan Huntret=0
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt$DIG $DIGOPTS . @10.53.0.1 soa > dig.out.ns1.test$n || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt$DIG $DIGOPTS . @10.53.0.2 soa > dig.out.ns2.test$n || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt$PERL ../digcomp.pl dig.out.ns1.test$n dig.out.ns2.test$n || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntgrep "flags:.*ad.*QUERY" dig.out.ns2.test$n > /dev/null || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntn=`expr $n + 1`
5832599943147268f9a4383d3dde39f8489bf339Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
5832599943147268f9a4383d3dde39f8489bf339Evan Huntstatus=`expr $status + $ret`
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt# Check test vectors (RFC 8080 + errata)
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Huntecho "I:checking that test vectors match ($n)"
5832599943147268f9a4383d3dde39f8489bf339Evan Huntret=0
5832599943147268f9a4383d3dde39f8489bf339Evan Huntgrep 'oL9krJun7xfBOIWcGHi7mag5/hdZrKWw15jP' ns2/example.com.db.signed > /dev/null || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntgrep 'VrbpMngwcrqNAg==' ns2/example.com.db.signed > /dev/null || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntgrep 'zXQ0bkYgQTEFyfLyi9QoiY6D8ZdYo4wyUhVi' ns2/example.com.db.signed > /dev/null || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntgrep 'R0O7KuI5k2pcBg==' ns2/example.com.db.signed > /dev/null || ret=1
5832599943147268f9a4383d3dde39f8489bf339Evan Huntn=`expr $n + 1`
5832599943147268f9a4383d3dde39f8489bf339Evan Huntif [ $ret != 0 ]; then echo "I:failed"; fi
5832599943147268f9a4383d3dde39f8489bf339Evan Huntstatus=`expr $status + $ret`
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt
5832599943147268f9a4383d3dde39f8489bf339Evan Huntecho "I:exit status: $status"
5832599943147268f9a4383d3dde39f8489bf339Evan Hunt[ $status -eq 0 ] || exit 1