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>
This commit is contained in:
Daniel P. Berrangé 2024-12-17 15:59:49 +00:00 committed by Thomas Huth
parent 3bb4c8b613
commit 37e9b19c34
6 changed files with 41 additions and 30 deletions

View file

@ -12,10 +12,11 @@
import time
import logging
from subprocess import check_call, DEVNULL
from qemu_test import QemuSystemTest, Asset
from qemu_test import exec_command, wait_for_console_pattern
from qemu_test import get_qemu_img, run_cmd
from qemu_test import get_qemu_img
class Aarch64VirtMachine(QemuSystemTest):
@ -96,7 +97,8 @@ class Aarch64VirtMachine(QemuSystemTest):
logger.info('creating scratch qcow2 image')
image_path = self.scratch_file('scratch.qcow2')
qemu_img = get_qemu_img(self)
run_cmd([qemu_img, 'create', '-f', 'qcow2', image_path, '8M'])
check_call([qemu_img, 'create', '-f', 'qcow2', image_path, '8M'],
stdout=DEVNULL, stderr=DEVNULL)
# Add the device
self.vm.add_args('-blockdev',