Use jinja2 templates in legacy test

The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.
This commit is contained in:
Nicki Křížek 2025-12-05 17:04:00 +01:00
parent cb88d1eda6
commit 1da733a015
13 changed files with 10 additions and 44 deletions

View file

@ -11,6 +11,8 @@
* information regarding copyright ownership.
*/
{% set dnssec_validation = dnssec_validation | default("no") %}
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
@ -20,7 +22,7 @@ options {
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
recursion yes;
dnssec-validation no;
dnssec-validation @dnssec_validation@;
};
@ -37,3 +39,7 @@ zone "." {
type primary;
file "root.db";
};
{% if dnssec_validation != "no" %}
include "trusted.conf";
{% endif %}

View file

@ -11,21 +11,6 @@
* information regarding copyright ownership.
*/
options {
query-source address 10.53.0.1;
notify-source 10.53.0.1;
transfer-source 10.53.0.1;
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
listen-on-v6 { none; };
recursion yes;
dnssec-validation yes;
};
{% set dnssec_validation = "yes" %}
zone "." {
type primary;
file "root.db";
};
include "trusted.conf";
{% include "ns1/named.conf.j2" %}

View file

@ -1,25 +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.
. ../conf.sh
copy_setports ns1/named1.conf.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
copy_setports ns5/named.conf.in ns5/named.conf
copy_setports ns6/named.conf.in ns6/named.conf
copy_setports ns7/named.conf.in ns7/named.conf
copy_setports ns8/named.conf.in ns8/named.conf
copy_setports ns9/named.conf.in ns9/named.conf
copy_setports ns10/named.conf.in ns10/named.conf

View file

@ -250,7 +250,7 @@ if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
stop_server --use-rndc --port ${CONTROLPORT} ns1
copy_setports ns1/named2.conf.in ns1/named.conf
cp ns1/named2.conf ns1/named.conf
start_server --noclean --restart --port ${PORT} ns1
n=$((n + 1))