mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-13 06:02:37 -04:00
Configuration files in system tests which require some variables (e.g. port numbers) filled in during test setup, can now use jinja2 templates when `jinja2` python package is available. Any `*.j2` file found within the system test directory will be automatically rendered with the environment variables into a file without the `.j2` extension by the pytest runner. E.g. `ns1/named.conf.j2` will become `ns1/named.conf` during test setup. To avoid automatic rendering, use `.j2.manual` extension and render the files manually at test time. New `templates` pytest fixture has been added. Its `render()` function can be used to render a template with custom test variables. This can be useful to fill in different config options during the test. With advanced jinja2 template syntax, it can also be used to include/omit entire sections of the config file rather than using `named1.conf.in`, `named2.conf.in` etc.
27 lines
913 B
Python
27 lines
913 B
Python
# 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.
|
|
|
|
from . import check
|
|
from . import instance
|
|
from . import query
|
|
from . import kasp
|
|
from . import name
|
|
from . import rndc
|
|
from . import run
|
|
from . import template
|
|
from . import log
|
|
from . import vars # pylint: disable=redefined-builtin
|
|
from . import hypothesis
|
|
|
|
# isctest.mark module is intentionally NOT imported, because it relies on
|
|
# environment variables which might not be set at the time of import of the
|
|
# `isctest` package. To use the marks, manual `import isctest.mark` is needed
|
|
# instead.
|