]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-network: merge stdout and stderr of invoked command by call()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Jul 2022 20:31:12 +0000 (22:31 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Jul 2022 20:38:21 +0000 (22:38 +0200)
Otherwise, the logs may be messed up.

test/test-network/systemd-networkd-tests.py

index 1e78b966aa235c9bf9c5b1aa79851669385e337e..a7ac4dbec58d567f197734f3e64b1e2f486c6100 100755 (executable)
@@ -97,9 +97,9 @@ def check_output(*command, text=True, **kwargs):
     return subprocess.run(command, check=True, universal_newlines=text, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kwargs).stdout.rstrip()
 
 def call(*command, text=True, **kwargs):
-    # This returns returncode. stdout and stderr are shown in console
+    # This returns returncode. stdout and stderr are merged and shown in console
     command = command[0].split() + list(command[1:])
-    return subprocess.run(command, check=False, universal_newlines=text, **kwargs).returncode
+    return subprocess.run(command, check=False, universal_newlines=text, stderr=subprocess.STDOUT, **kwargs).returncode
 
 def call_quiet(*command, text=True, **kwargs):
     command = command[0].split() + list(command[1:])