2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 01:59:26 +00:00

Convert ksr system test to pytest

Move all test cases from tests.sh to tests_ksr.py. The only test that
is not moved is the check that key id's match expected keys. The
shell-based system test checks two earlier set environment variables
against each other that has become redundant in the pytest variant,
because we now check the signed key response against a list of keys
and for each key we take into account the timing metadata. So we
already ensure that each published key is in the correct key bundle.
This commit is contained in:
Matthijs Mekking 2024-09-02 17:36:47 +02:00
parent a3829990fd
commit a15bf6704b
6 changed files with 1102 additions and 1282 deletions

View File

@ -1,38 +0,0 @@
#!/bin/sh
# 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.
set -e
rm -f ./*.ksk*
rm -f ./*.zsk*
rm -f ./created.out
rm -f ./footer.*
rm -f ./now.out
rm -f ./ns1/*.db
rm -f ./ns1/*.db.jbk
rm -f ./ns1/*.db.signed
rm -f ./ns1/*.db.signed.jnl
rm -f ./ns1/K*
rm -f ./ns1/keygen.out.*
rm -f ./ns1/named.conf
rm -f ./ns1/named.memstats
rm -f ./ns1/named.run
rm -f ./python.out
rm -f ./settime.out.*
rm -f ./ksr.*.err.*
rm -f ./ksr.*.expect
rm -f ./ksr.*.expect.*
rm -f ./ksr.*.out.*
rm -rf ./ns1/keydir
rm -rf ./ns1/offline

View File

@ -24,24 +24,5 @@ cp template.db.in past.test.db
cp template.db.in future.test.db
cp template.db.in last-bundle.test.db
cp template.db.in in-the-middle.test.db
# Create KSK for the various policies.
create_ksk() {
KSK=$($KEYGEN -l named.conf -fK -k $2 $1 2>keygen.out.$1)
num=0
for ksk in $KSK; do
num=$(($num + 1))
echo $ksk >"../${1}.ksk${num}.id"
cat "${ksk}.key" | grep -v ";.*" >"../$1.ksk$num"
mv "${ksk}.key" offline/
mv "${ksk}.private" offline/
mv "${ksk}.state" offline/
done
}
create_ksk common.test common
create_ksk past.test common
create_ksk future.test common
create_ksk last-bundle.test common
create_ksk in-the-middle.test common
create_ksk unlimited.test unlimited
create_ksk two-tone.test two-tone
cp template.db.in unlimited.test.db
cp template.db.in two-tone.test.db

View File

@ -16,8 +16,6 @@
set -e
$SHELL clean.sh
copy_setports ns1/named.conf.in ns1/named.conf
(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
# 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.
def test_ksr(run_tests_sh):
run_tests_sh()