tests.sh revision acce4b333de469c687908f3a04381f2897d242e9
#
# Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
status=0
do
ret=0
echo "I: checking that named-checkconf detects error in $bad"
done
do
ret=0
echo "I: checking that named-checkconf detects no error in $good"
done
# ns1: dnstap-reopen; ns2: dnstap -reopen; ns3: dnstap -roll
if [ -n "$FSTRM_CAPTURE" ] ; then
fi
# XXX: file output should be flushed once a second according
# to the libfstrm source, but it doesn't seem to happen until
# enough data has accumulated. to get all the output, we stop
# the name servers, forcing a flush on shutdown. it would be
# nice to find a better way to do this.
sleep 1
echo "I:checking initial message counts"
echo "I: checking UDP message counts"
ret=0
echo "I:ns1 $udp1 expected 0"
ret=1
}
echo "I:ns2 $udp2 expected 2"
ret=1
}
echo "I:ns3 $udp3 expected 4"
ret=1
}
echo "I: checking TCP message counts"
ret=0
echo "I:ns1 $tcp1 expected 6"
ret=1
}
echo "I:ns2 $tcp2 expected 2"
ret=1
}
echo "I:ns3 $tcp3 expected 6"
ret=1
}
echo "I: checking AUTH_QUERY message counts"
ret=0
echo "I:ns1 $aq1 exepcted 2"
ret=1
}
echo "I:ns2 $aq2 expected 1"
ret=1
}
echo "I:ns3 $aq3 expected 0"
ret=1
}
echo "I: checking AUTH_RESPONSE message counts"
ret=0
echo "I:ns1 $ar1 expected 2"
ret=1
}
echo "I:ns2 $ar2 expected 1"
ret=1
}
echo "I:ns3 $ar3 expected 0"
ret=1
}
echo "I: checking CLIENT_QUERY message counts"
ret=0
echo "I:ns1 $cq1 expected 1"
ret=1
}
echo "I:ns2 $cq2 expected 1"
ret=1
}
echo "I:ns3 $cq3 expected 2"
ret=1
}
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
echo "I:ns1 $cr1 expected 1"
ret=1
}
echo "I:ns2 $cr2 expected 1"
ret=1
}
echo "I:ns3 $cr3 expected 2"
ret=1
}
echo "I: checking RESOLVER_QUERY message counts"
ret=0
echo "I:ns1 $rq1 expected 0"
ret=1
}
echo "I:ns2 $rq2 expected 0"
ret=1
}
echo "I:ns3 $rq3 expected 3"
ret=1
}
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
echo "I:ns1 $rr1 expected 0"
ret=1
}
echo "I:ns2 $rr2 expected 0"
ret=1
}
echo "I:ns3 $rr3 expected 3"
ret=1
}
echo "I:checking reopened message counts"
echo "I: checking UDP message counts"
ret=0
echo "I:ns1 $udp1 expected 0"
ret=1
}
echo "I:ns2 $udp2 expected 0"
ret=1
}
echo "I:ns3 $udp3 expected 2"
ret=1
}
echo "I: checking TCP message counts"
ret=0
echo "I:ns1 $tcp1 expected 0"
ret=1
}
echo "I:ns2 $tcp2 expected 0"
ret=1
}
echo "I:ns3 $tcp3 expected 0"
ret=1
}
echo "I: checking AUTH_QUERY message counts"
ret=0
echo "I:ns1 $aq1 exepcted 0"
ret=1
}
echo "I:ns2 $aq2 expected 0"
ret=1
}
echo "I:ns3 $aq3 expected 0"
ret=1
}
echo "I: checking AUTH_RESPONSE message counts"
ret=0
echo "I:ns1 $ar1 expected 0"
ret=1
}
echo "I:ns2 $ar2 expected 0"
ret=1
}
echo "I:ns3 $ar3 expected 0"
ret=1
}
echo "I: checking CLIENT_QUERY message counts"
ret=0
echo "I:ns1 $cq1 expected 0"
ret=1
}
echo "I:ns2 $cq2 expected 0"
ret=1
}
echo "I:ns3 $cq3 expected 1"
ret=1
}
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
echo "I:ns1 $cr1 expected 0"
ret=1
}
echo "I:ns2 $cr2 expected 0"
ret=1
}
echo "I:ns3 $cr3 expected 1"
ret=1
}
echo "I: checking RESOLVER_QUERY message counts"
ret=0
echo "I:ns1 $rq1 expected 0"
ret=1
}
echo "I:ns2 $rq2 expected 0"
ret=1
}
echo "I:ns3 $rq3 expected 0"
ret=1
}
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
echo "I:ns1 $rr1 expected 0"
ret=1
}
echo "I:ns2 $rr2 expected 0"
ret=1
}
echo "I:ns3 $rr3 expected 0"
ret=1
}
if [ -n "$PYTHON" ] ; then
fi
if [ $HAS_PYYAML ] ; then
echo "I:checking dnstap-read YAML output"
ret=0
fi
if [ -n "$FSTRM_CAPTURE" ] ; then
echo "I:checking unix socket message counts"
sleep 2
kill $fstrm_capture_pid
wait
echo "I: checking UDP message counts"
ret=0
echo "I:ns4 $udp4 expected 2"
ret=1
}
echo "I: checking TCP message counts"
ret=0
echo "I:ns4 $tcp4 expected 0"
ret=1
}
echo "I: checking AUTH_QUERY message counts"
ret=0
echo "I:ns4 $aq4 expected 0"
ret=1
}
echo "I: checking AUTH_RESPONSE message counts"
ret=0
echo "I:ns4 $ar4 expected 0"
ret=1
}
echo "I: checking CLIENT_QUERY message counts"
ret=0
echo "I:ns4 $cq4 expected 1"
ret=1
}
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
echo "I:ns4 $cr4 expected 1"
ret=1
}
echo "I: checking RESOLVER_QUERY message counts"
ret=0
echo "I:ns4 $rq4 expected 0"
ret=1
}
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
echo "I:ns4 $rr4 expected 0"
ret=1
}
echo "I:checking reopened unix socket message counts"
sleep 2
kill $fstrm_capture_pid
wait
echo "I: checking UDP message counts"
ret=0
echo "I:ns4 $udp4 expected 2"
ret=1
}
echo "I: checking TCP message counts"
ret=0
echo "I:ns4 $tcp4 expected 0"
ret=1
}
echo "I: checking AUTH_QUERY message counts"
ret=0
echo "I:ns4 $aq4 expected 0"
ret=1
}
echo "I: checking AUTH_RESPONSE message counts"
ret=0
echo "I:ns4 $ar4 expected 0"
ret=1
}
echo "I: checking CLIENT_QUERY message counts"
ret=0
echo "I:ns4 $cq4 expected 1"
ret=1
}
echo "I: checking CLIENT_RESPONSE message counts"
ret=0
echo "I:ns4 $cr4 expected 1"
ret=1
}
echo "I: checking RESOLVER_QUERY message counts"
ret=0
echo "I:ns4 $rq4 expected 0"
ret=1
}
echo "I: checking RESOLVER_RESPONSE message counts"
ret=0
echo "I:ns4 $rr4 expected 0"
ret=1
}
fi
echo "I:exit status: $status"