From: Michal Nowak Date: Fri, 7 Feb 2025 10:26:04 +0000 (+0100) Subject: Add Dig interface X-Git-Tag: ondrej/lock-free-qpzone-reads-v1~57^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7347abd01f38ac77916c1ce8fb1cfff91d32aa94;p=thirdparty%2Fbind9.git Add Dig interface --- diff --git a/bin/tests/system/isctest/run.py b/bin/tests/system/isctest/run.py index eed356bbb5d..dd9dcb5515b 100644 --- a/bin/tests/system/isctest/run.py +++ b/bin/tests/system/isctest/run.py @@ -98,6 +98,18 @@ def _run_script( isctest.log.debug(" exited with %d", returncode) +class Dig: + def __init__(self, base_params: str = ""): + self.base_params = base_params + + def __call__(self, params: str) -> str: + """Run the dig command with the given parameters and return the decoded output.""" + return cmd( + [os.environ.get("DIG")] + f"{self.base_params} {params}".split(), + log_stdout=True, + ).stdout.decode("utf-8") + + def shell(script: str, args: Optional[List[str]] = None) -> None: """Run a given script with system's shell interpreter.""" _run_script(os.environ["SHELL"], script, args)