--- /dev/null
+; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+;
+; SPDX-License-Identifier: MPL-2.0
+;
+; 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 https://mozilla.org/MPL/2.0/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+$TTL 3600
+@ IN SOA ns2.small.test. hostmaster.small.test. 1 7200 3600 24796800 3600
+ IN NS ns2
+
+ns2 IN A 10.53.0.2
+
+a IN A 127.0.0.1
+
+dname IN DNAME branch.example.
+under.dname IN TXT "occluded"
+
+$GENERATE 1-10 child$ IN NS ns.example.
+
+child5 IN DS 7250 13 2 A30B3F78B6DDE9A4A9A2AD0C805518B4F49EC62E7D3F4531D33DE697 CDA01CB2
+++ /dev/null
-#!/bin/sh -e
-
-# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
-#
-# SPDX-License-Identifier: MPL-2.0
-#
-# 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 https://mozilla.org/MPL/2.0/.
-#
-# See the COPYRIGHT file distributed with this work for additional
-# information regarding copyright ownership.
-
-. ../conf.sh
def test_optout(ns2):
zone = "test"
+ expect_nsec3param = True
# Wait until the provided zone is signed and then verify its DNSSEC data.
def check_nsec3param():
response = do_query(ns2, zone, "NSEC3PARAM")
- return has_nsec3param(zone, response)
+ if expect_nsec3param:
+ return has_nsec3param(zone, response)
+ return not has_nsec3param(zone, response)
# check zone is fully signed.
- isctest.run.retry_with_timeout(check_nsec3param, timeout=300)
+ isctest.run.retry_with_timeout(check_nsec3param, timeout=100)
+
+ # check if zone if DNSSEC valid.
+ transfer = do_xfr(ns2, zone)
+ assert verify_zone(zone, transfer)
+
+
+def test_optout_to_nsec(ns2, templates):
+ zone = "small.test"
+ expect_nsec3param = True
+
+ # Wait until the provided zone is signed and then verify its DNSSEC data.
+ def check_nsec3param():
+ response = do_query(ns2, zone, "NSEC3PARAM")
+ if expect_nsec3param:
+ return has_nsec3param(zone, response)
+ return not has_nsec3param(zone, response)
+
+ # check zone is fully signed.
+ isctest.run.retry_with_timeout(check_nsec3param, timeout=100)
+
+ # check if zone if DNSSEC valid.
+ transfer = do_xfr(ns2, zone)
+ assert verify_zone(zone, transfer)
+
+ # reconfigure to NSEC.
+ data = {
+ "reconfiged": True,
+ }
+ templates.render(f"{ns2.identifier}/named.conf", data)
+ ns2.reconfigure()
+
+ # wait until NSEC3PARAM is removed.
+ expect_nsec3param = False
+ isctest.run.retry_with_timeout(check_nsec3param, timeout=100)
# check if zone if DNSSEC valid.
transfer = do_xfr(ns2, zone)