]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API: tests: have sdig helper return sdig output
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Wed, 12 Oct 2022 14:13:22 +0000 (16:13 +0200)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Wed, 12 Oct 2022 14:17:08 +0000 (16:17 +0200)
regression-tests.api/test_helper.py

index af7c90845213875ce757c948f1e29afaed35d5a9..0618bd9478a1e34b556dacd0a61211529ec5a8ed 100644 (file)
@@ -116,10 +116,11 @@ def pdnsutil_rectify(zonename):
     pdnsutil('rectify-zone', zonename)
 
 def sdig(*args):
+    sdig_command_line = [SDIG, '127.0.0.1', str(DNSPORT)] + list(args)
     try:
-        return subprocess.check_call([SDIG, '127.0.0.1', str(DNSPORT)] + list(args))
+        return subprocess.check_output(sdig_command_line).decode('utf-8')
     except subprocess.CalledProcessError as except_inst:
-        raise RuntimeError("sdig %s %s failed: %s" % (command, args, except_inst.output.decode('ascii', errors='replace')))
+        raise RuntimeError("sdig %s failed: %s" % (sdig_command_line, except_inst.output.decode('ascii', errors='replace')))
 
 def get_db_tsigkeys(keyname):
     db, placeholder = get_auth_db()