mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 10:10:06 +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:
parent
a3829990fd
commit
a15bf6704b
@ -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
|
|
@ -24,24 +24,5 @@ cp template.db.in past.test.db
|
|||||||
cp template.db.in future.test.db
|
cp template.db.in future.test.db
|
||||||
cp template.db.in last-bundle.test.db
|
cp template.db.in last-bundle.test.db
|
||||||
cp template.db.in in-the-middle.test.db
|
cp template.db.in in-the-middle.test.db
|
||||||
|
cp template.db.in unlimited.test.db
|
||||||
# Create KSK for the various policies.
|
cp template.db.in two-tone.test.db
|
||||||
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
|
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
$SHELL clean.sh
|
|
||||||
|
|
||||||
copy_setports ns1/named.conf.in ns1/named.conf
|
copy_setports ns1/named.conf.in ns1/named.conf
|
||||||
|
|
||||||
(
|
(
|
||||||
|
File diff suppressed because it is too large
Load Diff
1100
bin/tests/system/ksr/tests_ksr.py
Normal file
1100
bin/tests/system/ksr/tests_ksr.py
Normal file
File diff suppressed because it is too large
Load Diff
@ -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()
|
|
Loading…
x
Reference in New Issue
Block a user