diff options
Diffstat (limited to '')
-rw-r--r-- | bin/tests/virtual-time/slave/clean.sh | 17 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/ns1/example.db.in | 21 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/ns1/named.conf | 45 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/ns1/root.db | 23 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/ns1/wrap.sh | 17 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/setup.sh | 11 | ||||
-rw-r--r-- | bin/tests/virtual-time/slave/tests.sh | 42 |
7 files changed, 176 insertions, 0 deletions
diff --git a/bin/tests/virtual-time/slave/clean.sh b/bin/tests/virtual-time/slave/clean.sh new file mode 100644 index 0000000..780e8b2 --- /dev/null +++ b/bin/tests/virtual-time/slave/clean.sh @@ -0,0 +1,17 @@ +# Copyright (C) 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/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# +# Clean up after virtual time tests. +# +rm -f dig.out.* +rm -f ns1/named.memstats +rm -f ns1/vtwrapper.* +rm -f ns1/example.db +rm -f ns*/named.lock diff --git a/bin/tests/virtual-time/slave/ns1/example.db.in b/bin/tests/virtual-time/slave/ns1/example.db.in new file mode 100644 index 0000000..9b54373 --- /dev/null +++ b/bin/tests/virtual-time/slave/ns1/example.db.in @@ -0,0 +1,21 @@ +; Copyright (C) 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/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +$TTL 300 ; 5 minutes +@ IN SOA ns root ( + 2000042100 ; serial + 600 ; refresh + 600 ; retry + 12000 ; expire + 600 ; minimum + ) + NS ns +ns A 10.53.0.1 + +txt TXT "recursed" diff --git a/bin/tests/virtual-time/slave/ns1/named.conf b/bin/tests/virtual-time/slave/ns1/named.conf new file mode 100644 index 0000000..5cd3931 --- /dev/null +++ b/bin/tests/virtual-time/slave/ns1/named.conf @@ -0,0 +1,45 @@ +/* + * Copyright (C) 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/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +controls { /* empty */ }; + +options { + query-source address 10.53.0.1; + notify-source 10.53.0.1; + transfer-source 10.53.0.1; + port 5300; + pid-file "named.pid"; + listen-on { 10.53.0.1; }; + listen-on-v6 { none; }; + recursion no; + notify no; +}; + +key rndc_key { + secret "1234abcd8765"; + algorithm hmac-md5; +}; + +controls { + inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; }; +}; + +zone "." { + type master; + file "root.db"; +}; + +zone "example." { + type slave; + masters { 10.53.0.111; }; + file "example.db"; +}; + diff --git a/bin/tests/virtual-time/slave/ns1/root.db b/bin/tests/virtual-time/slave/ns1/root.db new file mode 100644 index 0000000..d2c6cd4 --- /dev/null +++ b/bin/tests/virtual-time/slave/ns1/root.db @@ -0,0 +1,23 @@ +; Copyright (C) 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/. +; +; See the COPYRIGHT file distributed with this work for additional +; information regarding copyright ownership. + +$TTL 300 +. IN SOA gson.nominum.com. a.root.servers.nil. ( + 2000082401 ; serial + 1800 ; refresh (30 minutes) + 1800 ; retry (30 minutes) + 1814400 ; expire (3 weeks) + 3600 ; minimum (1 hour) + ) +. NS a.root-servers.nil. +a.root-servers.nil. A 10.53.0.1 + +example NS ns.example +ns.example A 10.53.0.1 + diff --git a/bin/tests/virtual-time/slave/ns1/wrap.sh b/bin/tests/virtual-time/slave/ns1/wrap.sh new file mode 100644 index 0000000..9bc15bb --- /dev/null +++ b/bin/tests/virtual-time/slave/ns1/wrap.sh @@ -0,0 +1,17 @@ +# Copyright (C) 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/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# +# Wrapper for named +# + +LD_PRELOAD=../../libvtwrapper.so +export LD_PRELOAD + +exec $* diff --git a/bin/tests/virtual-time/slave/setup.sh b/bin/tests/virtual-time/slave/setup.sh new file mode 100644 index 0000000..4b385e8 --- /dev/null +++ b/bin/tests/virtual-time/slave/setup.sh @@ -0,0 +1,11 @@ +# Copyright (C) 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/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +rm -f ns1/example.db +cp ns1/example.db.in ns1/example.db diff --git a/bin/tests/virtual-time/slave/tests.sh b/bin/tests/virtual-time/slave/tests.sh new file mode 100644 index 0000000..3768910 --- /dev/null +++ b/bin/tests/virtual-time/slave/tests.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# +# Copyright (C) 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/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +SYSTEMTESTTOP=.. +. $SYSTEMTESTTOP/conf.sh + +status=0 + +rm -f dig.out.* + +DIGOPTS="+tcp +noadd +nosea +nostat +nocmd -p 5300" + +echo "I:checking slave expiry" +ret=0 +$DIG $DIGOPTS txt.example. txt @10.53.0.1 > dig.out.before || ret=1 +echo "I:waiting for expiry (10s real, 6h virtual)" +sleep 10 +$DIG $DIGOPTS txt.example. txt @10.53.0.1 > dig.out.after || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + +ret=0 +grep "status: NOERROR" dig.out.before > /dev/null || ret=1 +if [ $ret -eq 1 ] ; then + echo "I:failed (before)"; status=1 +fi +ret=0 +grep "status: SERVFAIL" dig.out.after > /dev/null || ret=1 +if [ $ret -eq 1 ] ; then + echo "I:failed (after)"; status=1 +fi + +echo "I:exit status: $status" +exit $status |