From: Chris Hofstaedtler Date: Wed, 12 Oct 2022 14:13:22 +0000 (+0200) Subject: API: tests: have sdig helper return sdig output X-Git-Tag: dnsdist-1.8.0-rc1~202^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68fe406a32ec14c8dfc197f3aa60681aa8d7905f;p=thirdparty%2Fpdns.git API: tests: have sdig helper return sdig output --- diff --git a/regression-tests.api/test_helper.py b/regression-tests.api/test_helper.py index af7c908452..0618bd9478 100644 --- a/regression-tests.api/test_helper.py +++ b/regression-tests.api/test_helper.py @@ -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()