summary refs log tree commit diff stats
path: root/tests/functional/qemu_test/tuxruntest.py
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2024-12-17 15:59:49 +0000
committerThomas Huth <thuth@redhat.com>2024-12-17 19:39:53 +0100
commit37e9b19c34d9500164e33ccf377e1830e956bca0 (patch)
tree4699be481053c51effb54772ffc6d81c965b3234 /tests/functional/qemu_test/tuxruntest.py
parent3bb4c8b6134df5367675c4ade4f5c177d29fe903 (diff)
downloadfocaccia-qemu-37e9b19c34d9500164e33ccf377e1830e956bca0.tar.gz
focaccia-qemu-37e9b19c34d9500164e33ccf377e1830e956bca0.zip
tests/functional: replace 'run_cmd' with subprocess helpers
The 'run_cmd' helper is re-implementing a convenient helper that
already exists in the form of the 'run' and 'check_call' methods
provided by 'subprocess'.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20241217155953.3950506-29-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/tuxruntest.py')
-rw-r--r--tests/functional/qemu_test/tuxruntest.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/functional/qemu_test/tuxruntest.py b/tests/functional/qemu_test/tuxruntest.py
index 0b1bb8f0ed..7227a83757 100644
--- a/tests/functional/qemu_test/tuxruntest.py
+++ b/tests/functional/qemu_test/tuxruntest.py
@@ -11,11 +11,12 @@
 
 import os
 import stat
+from subprocess import check_call, DEVNULL
 
 from qemu_test import QemuSystemTest
 from qemu_test import exec_command_and_wait_for_pattern
 from qemu_test import wait_for_console_pattern
-from qemu_test import which, run_cmd, get_qemu_img
+from qemu_test import which, get_qemu_img
 
 class TuxRunBaselineTest(QemuSystemTest):
 
@@ -76,8 +77,9 @@ class TuxRunBaselineTest(QemuSystemTest):
 
         disk_image = self.scratch_file("rootfs.ext4")
 
-        run_cmd(['zstd', "-f", "-d", disk_image_zst,
-                 "-o", disk_image])
+        check_call(['zstd', "-f", "-d", disk_image_zst,
+                    "-o", disk_image],
+                   stdout=DEVNULL, stderr=DEVNULL)
         # zstd copies source archive permissions for the output
         # file, so must make this writable for QEMU
         os.chmod(disk_image, stat.S_IRUSR | stat.S_IWUSR)