tests.sh revision a3128c1995310262648e575a9ff148d5741fd167
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Copyright (C) 2010, 2012 Internet Systems Consortium, Inc. ("ISC")
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Permission to use, copy, modify, and/or distribute this software for any
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# purpose with or without fee is hereby granted, provided that the above
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# copyright notice and this permission notice appear in all copies.
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# PERFORMANCE OF THIS SOFTWARE.
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# $Id: tests.sh,v 1.3 2010/12/02 23:22:41 marka Exp $
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test of allow-query statement.
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# allow-query takes an address match list and can be included in either the
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# options statement or in the zone statement. This test assumes that the
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# acl tests cover the details of the address match list and uses a limited
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# number of address match test cases to ensure that allow-query finds the
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# expected match.
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# default (any), any, none, [localhost, localnets],
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# allowed address, not allowed address, denied address,
999ae80184e3df1016ac74514124b0459ace4d01Andreas Gustafsson# allowed key, not allowed key, denied key
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# allowed acl, not allowed acl, denied acl (acls pointing to addresses)
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# Each of these tests requires changing to a new configuration
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# file and using rndc to update the server
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# In view, with nothing in options (default to any)
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# default (any), any, none, [localhost, localnets],
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# allowed address, not allowed address, denied address,
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# allowed key, not allowed key, denied key
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# allowed acl, not allowed acl, denied acl (acls pointing to addresses)
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In view, with options set to none, view set to any
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In view, with options set to any, view set to none
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In zone, with nothing in options (default to any)
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# any, none, [localhost, localnets],
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# allowed address, denied address,
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# allowed key, not allowed key, denied key
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# allowed acl, not allowed acl, denied acl (acls pointing to addresses),
d60f5b9bc8c1e1f7ddebc6c7834f7550a8e8be6fBob Halley# In zone, with options set to none, zone set to any
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In zone, with options set to any, zone set to none
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In zone, with view set to none, zone set to any
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# In zone, with view set to any, zone set to none
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# zone types of master, slave and stub can be tested in parallel by using
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# multiple instances (ns2 as master, ns3 as slave, ns4 as stub) and querying
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# as necessary.
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas GustafssonDIGOPTS="+tcp +nosea +nostat +nocmd +norec +noques +noauth +noadd +nostats +dnssec -p 5300"
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson# Test 1 - default, query allowed
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonecho "I:test $n: default - query allowed"
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# Test 2 - explicit any, query allowed
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonecho "I:test $n: explicit any - query allowed"
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# Test 3 - none, query refused
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonecho "I:test $n: none - query refused"
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# Test 4 - address allowed, query allowed
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonecho "I:test $n: address allowed - query allowed"
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# Test 5 - address not allowed, query refused
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonecho "I:test $n: address not allowed - query refused"
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
8803b0510877fd08044542edbb55e2be72fae36fAndreas Gustafsson# Test 6 - address disallowed, query refused
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: address disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafsson# Test 7 - acl allowed, query allowed
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssonecho "I:test $n: acl allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
581db30788a4920ba8558287a0dccf3c1a210c5aAndreas Gustafsson# Test 8 - acl not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: acl not allowed - query refused"
b2c71d98dfc4dab5c6b8c8f39cf8fed3d899e94cAndreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 9 - acl disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: acl disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 10 - key allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: key allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 11 - key not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: key not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 12 - key disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: key disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# The next set of tests check if allow-query works in a view
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 21 - views default, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views default - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 22 - views explicit any, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views explicit any - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 23 - views none, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views none - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 24 - views address allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views address allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 25 - views address not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views address not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 26 - views address disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views address disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 27 - views acl allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views acl allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 28 - views acl not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views acl not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 29 - views acl disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleyecho "I:test $n: views acl disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 30 - views key allowed, query allowed
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views key allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 31 - views key not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views key not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleygrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 32 - views key disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views key disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 33 - views over options, views allow, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views over options, views allow - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 34 - views over options, views disallow, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views over options, views disallow - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Tests for allow-query in the zone statements
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 41 - zone default, query allowed
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonecho "I:test $n: zone default - query allowed"
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson# Test 42 - zone explicit any, query allowed
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonecho "I:test $n: zone explicit any - query allowed"
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.any.example a > dig.out.ns2.$n || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssongrep '^a.any.example' dig.out.ns2.$n > /dev/null || ret=1
f4c0131a46ea183238027ef9c3400cc6079b8b85Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 43 - zone none, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone none - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.none.example a > dig.out.ns2.$n || ret=1
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleygrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleygrep '^a.none.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 44 - zone address allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone address allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.addrallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.addrallow.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 45 - zone address not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone address not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.addrnotallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.addrnotallow.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 46 - zone address disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone address disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.addrdisallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.addrdisallow.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 47 - zone acl allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone acl allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.aclallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.aclallow.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 48 - zone acl not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone acl not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.aclnotallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.aclnotallow.example' dig.out.ns2.$n > /dev/null && ret=1
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halley# Test 49 - zone acl disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone acl disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.acldisallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.acldisallow.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 50 - zone key allowed, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone key allowed - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.keyallow.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 51 - zone key not allowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone key not allowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y two:1234efgh8765 a.keyallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 52 - zone key disallowed, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zone key disallowed - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 -y one:1234abcd8765 a.keydisallow.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
732e0731dec1922747bb3b3147cf2c3d16b22eaaBob Halleygrep '^a.keydisallow.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 53 - zones over options, zones allow, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views over options, views allow - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 54 - zones over options, zones disallow, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: views over options, views disallow - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 55 - zones over views, zones allow, query allowed
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zones over views, views allow - query allowed"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson# Test 56 - zones over views, zones disallow, query refused
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:test $n: zones over views, views disallow - query refused"
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafsson$DIG $DIGOPTS @10.53.0.2 -b 10.53.0.2 a.normal.example a > dig.out.ns2.$n || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssongrep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonif [ $ret != 0 ]; then echo "I:failed"; fi
4cd3d6df39927315e3fadc07a8da3788175f4195Andreas Gustafssonecho "I:exit status: $status"