675d004f498f4a3a3fd7433deaef230ffddbc263Tinderbox User# Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 reconfig 2>&1 | sed 's/^/I:ns3 /'
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień $RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 flush | sed 's/^/I: ns3 /'
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień if grep "started AAAA fetch" ns3/named.run >/dev/null; then
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# Check whether the number of queries ans2 received from ns3 (this value is
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# read from dig output stored in file $1) is as expected. The expected query
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# count is variable:
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# - if ns3 sends AAAA queries, the query count should equal $2,
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień# - if ns3 does not send AAAA queries, the query count should equal $3.
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: set max-recursion-depth=12"
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt excessive-depth lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect1.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt permissible lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect2.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: set max-recursion-depth=5"
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt excessive-depth lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect3.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt permissible lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect4.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: set max-recursion-depth=100, max-recursion-queries=50"
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt excessive-queries lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect5.example.org > dig.out.1.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn[ $count -le 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt permissible lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect6.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn[ $count -le 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: set max-recursion-depth=100, max-recursion-queries=40"
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt excessive-queries lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect7.example.org > dig.out.1.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn grep "status: SERVFAIL" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn[ $count -le 40 ] || { ret=1; echo "I: count ($count) !<= 40"; }
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępieńecho "I: attempt permissible lookup ($n)"
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
012ce6857e612b25ab2c2052eb505a0944c15107Mark Andrews$DIG $DIGOPTS @10.53.0.3 indirect8.example.org > dig.out.1.test$n || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntgrep "status: NOERROR" dig.out.1.test$n > /dev/null || ret=1
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Hunt$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn[ $count -le 40 ] || { ret=1; echo "I: count ($count) !<= 40"; }
05e448935cb2d6ab08c24257f6536362d3496512Evan Huntecho "I: attempting NS explosion ($n)"
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień$DIG $DIGOPTS @10.53.0.2 reset > /dev/null || ret=1
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt$DIG $DIGOPTS +short @10.53.0.3 ns1.1.example.net > dig.out.1.test$n || ret=1
2d517e233ff3b3fcd272eb5b2e2d3db6d31a1681Michał Kępień$DIG $DIGOPTS +short @10.53.0.2 count txt > dig.out.2.test$n || ret=1
05e448935cb2d6ab08c24257f6536362d3496512Evan Hunt$DIG $DIGOPTS +short @10.53.0.7 count txt > dig.out.3.test$n || ret=1
9effea437d7973c9ed981ab2e14b219182d86ee7Curtis Blackburn[ $count -lt 50 ] || { ret=1; echo "I: count ($count) !<= 50"; }
c4f54e5bd1cd09f601252627b5b26768ab797742Evan Huntecho "I:exit status: $status"