]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Log command stdout when using isctest.run.cmd()
authorNicki Křížek <nicki@isc.org>
Thu, 26 Jun 2025 14:18:01 +0000 (16:18 +0200)
committerNicki Křížek <nicki@isc.org>
Fri, 27 Jun 2025 14:31:49 +0000 (16:31 +0200)
The command's stdout may provide useful debug info, so make sure we log
it by default. It doesn't seem to have a significant impact on the log
size.

bin/tests/system/dnstap/tests_dnstap.py
bin/tests/system/isctest/kasp.py
bin/tests/system/isctest/run.py
bin/tests/system/kasp/tests_kasp.py
bin/tests/system/keyfromlabel/tests_keyfromlabel.py
bin/tests/system/ksr/tests_ksr.py
bin/tests/system/rollover/tests_rollover.py
bin/tests/system/rsabigexponent/tests_rsabigexponent.py
bin/tests/system/verify/tests_verify.py

index 258d2b5f892672c771a92f20445af47751cf0d2e..e804eaa9ffd3096f618ee42eaef9e9f6f4ed099b 100644 (file)
@@ -44,7 +44,7 @@ def run_rndc(server, rndc_command):
     cmdline = [rndc, "-c", "../_common/rndc.conf", "-p", port, "-s", server]
     cmdline.extend(rndc_command)
 
-    isctest.run.cmd(cmdline, log_stdout=True)
+    isctest.run.cmd(cmdline)
 
 
 def test_dnstap_dispatch_socket_addresses():
@@ -64,7 +64,6 @@ def test_dnstap_dispatch_socket_addresses():
     # Read the contents of the dnstap file using dnstap-read.
     run = isctest.run.cmd(
         [isctest.vars.ALL["DNSTAPREAD"], "dnstap.out.resolver_addresses"],
-        log_stdout=True,
     )
 
     # Check whether all frames contain the expected addresses.
index 26ab63c740f90f15c2dad83162a5a9d3b11ecaad..6a5e8ecde69451967f0aa4514a215e426f44731a 100644 (file)
@@ -459,7 +459,7 @@ class Key:
             str(self.keyfile),
         ]
 
-        out = isctest.run.cmd(dsfromkey_command, log_stdout=True)
+        out = isctest.run.cmd(dsfromkey_command)
         dsfromkey = out.stdout.decode("utf-8").split()
 
         rdata_fromfile = " ".join(dsfromkey[:7])
index 4c3acc5d2b666f5ac2846a283dbf6fa2ddd4970a..e4fbd459dd26cfc172836be995e05a6165b4543d 100644 (file)
@@ -24,7 +24,7 @@ def cmd(
     timeout=60,
     stdout=subprocess.PIPE,
     stderr=subprocess.PIPE,
-    log_stdout=False,
+    log_stdout=True,
     log_stderr=True,
     input_text: Optional[bytes] = None,
     raise_on_exception=True,
@@ -111,7 +111,6 @@ class Dig:
         """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")
 
 
index 2440914995af7521d7a5371a690b2ccb3fb6221e..9ffd70b87ca54c775494999b4575dfe49fb940a6 100644 (file)
@@ -1258,7 +1258,7 @@ def test_kasp_dnssec_keygen():
             zone,
         ]
 
-        return isctest.run.cmd(keygen_command, log_stdout=True).stdout.decode("utf-8")
+        return isctest.run.cmd(keygen_command).stdout.decode("utf-8")
 
     # check that 'dnssec-keygen -k' (configured policy) creates valid files.
     keyprops = [
@@ -1294,7 +1294,7 @@ def test_kasp_dnssec_keygen():
         str(publish),
         key.path,
     ]
-    out = isctest.run.cmd(settime, log_stdout=True).stdout.decode("utf-8")
+    out = isctest.run.cmd(settime).stdout.decode("utf-8")
 
     isctest.check.file_contents_equal(f"{key.statefile}", f"{key.statefile}.backup")
     assert key.get_metadata("Publish", file=key.privatefile) == str(publish)
@@ -1343,7 +1343,7 @@ def test_kasp_dnssec_keygen():
         str(now),
         key.path,
     ]
-    out = isctest.run.cmd(settime, log_stdout=True).stdout.decode("utf-8")
+    out = isctest.run.cmd(settime).stdout.decode("utf-8")
     isctest.kasp.check_keys("kasp", keys, expected)
     isctest.kasp.check_keytimes(keys, expected)
 
@@ -1378,7 +1378,7 @@ def test_kasp_dnssec_keygen():
         str(now),
         key.path,
     ]
-    out = isctest.run.cmd(settime, log_stdout=True).stdout.decode("utf-8")
+    out = isctest.run.cmd(settime).stdout.decode("utf-8")
     isctest.kasp.check_keys("kasp", keys, expected)
     isctest.kasp.check_keytimes(keys, expected)
 
@@ -1423,7 +1423,7 @@ def test_kasp_dnssec_keygen():
         str(soon),
         key.path,
     ]
-    out = isctest.run.cmd(settime, log_stdout=True).stdout.decode("utf-8")
+    out = isctest.run.cmd(settime).stdout.decode("utf-8")
     isctest.kasp.check_keys("kasp", keys, expected)
     isctest.kasp.check_keytimes(keys, expected)
 
index dc3fe553286fd973a0b17aaa46cb9bfb55354322..ae9305df3eeba7800c7e11756a00a48d046e07a6 100644 (file)
@@ -70,13 +70,12 @@ def token_init_and_cleanup():
     isctest.run.cmd(
         token_cleanup_command,
         env=EMPTY_OPENSSL_CONF_ENV,
-        log_stdout=True,
         raise_on_exception=False,
     )
 
     try:
         output = isctest.run.cmd(
-            token_init_command, env=EMPTY_OPENSSL_CONF_ENV, log_stdout=True
+            token_init_command, env=EMPTY_OPENSSL_CONF_ENV
         ).stdout.decode("utf-8")
         assert "The token has been initialized and is reassigned to slot" in output
         yield
@@ -84,7 +83,6 @@ def token_init_and_cleanup():
         output = isctest.run.cmd(
             token_cleanup_command,
             env=EMPTY_OPENSSL_CONF_ENV,
-            log_stdout=True,
             raise_on_exception=False,
         ).stdout.decode("utf-8")
         assert re.search("Found token (.*) with matching token label", output)
@@ -129,7 +127,7 @@ def test_keyfromlabel(alg_name, alg_type, alg_bits):
         ]
 
         output = isctest.run.cmd(
-            pkcs11_command, env=EMPTY_OPENSSL_CONF_ENV, log_stdout=True
+            pkcs11_command, env=EMPTY_OPENSSL_CONF_ENV
         ).stdout.decode("utf-8")
 
         assert "Key pair generated" in output
@@ -147,7 +145,7 @@ def test_keyfromlabel(alg_name, alg_type, alg_bits):
             zone,
         ]
 
-        output = isctest.run.cmd(keyfrlab_command, log_stdout=True)
+        output = isctest.run.cmd(keyfrlab_command)
         output_decoded = output.stdout.decode("utf-8").rstrip() + ".key"
 
         assert os.path.exists(output_decoded)
@@ -186,6 +184,6 @@ def test_keyfromlabel(alg_name, alg_type, alg_bits):
         zone,
         zone_file,
     ]
-    isctest.run.cmd(signer_command, log_stdout=True)
+    isctest.run.cmd(signer_command)
 
     assert os.path.exists(f"{zone_file}.signed")
index fa09e85d84ab5cde68ad498c476387e0f34b5042..ed8c18c31bbef07a9713e2138f53026ce6ef7ab5 100644 (file)
@@ -96,9 +96,7 @@ def ksr(zone, policy, action, options="", raise_on_exception=True):
         zone,
     ]
 
-    out = isctest.run.cmd(
-        ksr_command, log_stdout=True, raise_on_exception=raise_on_exception
-    )
+    out = isctest.run.cmd(ksr_command, raise_on_exception=raise_on_exception)
     return out.stdout.decode("utf-8"), out.stderr.decode("utf-8")
 
 
index f30eb2fad99c4c6fcfc1d8b8be66eeb96eb60f84..c42f3ef0658dd32d2d68ea26ba1d5c11c9f05ddd 100644 (file)
@@ -265,7 +265,7 @@ def test_rollover_multisigner(servers):
             zone,
         ]
 
-        return isctest.run.cmd(keygen_command, log_stdout=True).stdout.decode("utf-8")
+        return isctest.run.cmd(keygen_command).stdout.decode("utf-8")
 
     zone = "multisigner-model2.kasp"
 
index 9d02346c44776015810a75ed9751f4a4b4f8925a..e42e114f728c03459db7078ecb41a8afccb54745 100644 (file)
@@ -42,7 +42,7 @@ def test_max_rsa_exponent_size_good(exponent_size, templates):
 def test_max_rsa_exponent_size_bad(exponent_size, templates):
     templates.render("options.conf", {"max_rsa_exponent_size": exponent_size})
     with pytest.raises(subprocess.CalledProcessError):
-        isctest.run.cmd([CHECKCONF, "options.conf"], log_stdout=True)
+        isctest.run.cmd([CHECKCONF, "options.conf"])
 
 
 def test_rsa_big_exponent_keys_cant_load():
index ae82dee1c53dde5a365e1fb0a71da86fc777bb47..203c2181be14e586f2305f914e580e3e46d07ebb 100644 (file)
@@ -47,7 +47,7 @@ VERIFY = os.environ.get("VERIFY")
     ],
 )
 def test_verify_good_zone_files(zone):
-    isctest.run.cmd([VERIFY, "-z", "-o", zone, f"zones/{zone}.good"], log_stdout=True)
+    isctest.run.cmd([VERIFY, "-z", "-o", zone, f"zones/{zone}.good"])
 
 
 def test_verify_good_zone_nsec_next_name_case_mismatch():
@@ -58,7 +58,6 @@ def test_verify_good_zone_nsec_next_name_case_mismatch():
             "nsec-next-name-case-mismatch",
             "zones/nsec-next-name-case-mismatch.good",
         ],
-        log_stdout=True,
     )
 
 
@@ -67,7 +66,6 @@ def get_bad_zone_output(zone):
     output = isctest.run.cmd(
         [VERIFY, *only_opt, "-o", zone, f"zones/{zone}.bad"],
         raise_on_exception=False,
-        log_stdout=True,
     )
     stream = (output.stdout + output.stderr).decode("utf-8").replace("\n", "")
     return stream