2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

Add reconfiguration support to NamedInstance

Reconfiguring named using RNDC is a common action in BIND 9 system
tests.  It involves sending the "reconfig" RNDC command to a named
instance and waiting until it is fully processed.  Add a reconfigure()
method to the NamedInstance class in order to simplify and standardize
named reconfiguration using RNDC in Python-based system tests.

TODO:

  - full reconfiguration support (w/templating *.in files)

  - add an "rndc null" before every reconfiguration to show which file
    is used (NamedInstance.add_mark_to_log() as it may be generically
    useful?)
This commit is contained in:
Michał Kępień
2023-07-25 14:37:05 +02:00
committed by Štěpán Balážik
parent 989d22473d
commit fdc45c70e8

View File

@@ -142,6 +142,15 @@ class NamedInstance:
"""
return WatchLogFromHere(self._log_file)
def reconfigure(self) -> None:
"""
Reconfigure this named `instance` and wait until reconfiguration is
finished. Raise an `RNDCException` if reconfiguration fails.
"""
with self.watch_log_from_here() as watcher:
self.rndc("reconfig")
watcher.wait_for_line("any newly configured zones are now loaded")
def _rndc_log(self, command: str, response: str) -> None:
"""
Log an `rndc` invocation (and its output) to the `rndc.log` file in the