1 # Copyright (C) Internet Systems Consortium, Inc. ("ISC") 2 # 3 # SPDX-License-Identifier: MPL-2.0 4 # 5 # This Source Code Form is subject to the terms of the Mozilla Public 6 # License, v. 2.0. If a copy of the MPL was not distributed with this 7 # file, you can obtain one at https://mozilla.org/MPL/2.0/. 8 # 9 # See the COPYRIGHT file distributed with this work for additional 10 # information regarding copyright ownership. 11 12 # pylint: disable=redefined-outer-name,unused-import 13 14 import pytest 15 16 import isctest 17 from isctest.util import param 18 from rollover.common import ( 19 pytestmark, 20 alg, 21 size, 22 CDSS, 23 DEFAULT_CONFIG, 24 DURATION, 25 ) 26 27 28 @pytest.mark.parametrize( 29 "zone, policy, lifetime", 30 [ 31 param("shorter-lifetime", "long-lifetime", "P1Y"), 32 param("longer-lifetime", "short-lifetime", "P6M"), 33 param("limit-lifetime", "unlimited-lifetime", 0), 34 param("unlimit-lifetime", "short-lifetime", "P6M"), 35 ], 36 ) 37 def test_lifetime_initial(zone, policy, lifetime, alg, size, ns3): 38 config = DEFAULT_CONFIG 39 40 isctest.kasp.wait_keymgr_done(ns3, f"{zone}.kasp") 41 42 step = { 43 "zone": f"{zone}.kasp", 44 "cdss": CDSS, 45 "keyprops": [ 46 f"csk {DURATION[lifetime]} {alg} {size} goal:omnipresent dnskey:rumoured krrsig:rumoured zrrsig:rumoured ds:hidden", 47 ], 48 "nextev": None, 49 } 50 isctest.kasp.check_rollover_step(ns3, config, policy, step) 51