mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
tests/functional: switch over to using self.build_file(...)
This removes direct access of the 'BUILD_DIR' variable. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-13-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
bcc12768c2
commit
8b5a0dd3a8
4 changed files with 9 additions and 16 deletions
|
@ -16,7 +16,6 @@ import os
|
|||
import os.path
|
||||
import subprocess
|
||||
|
||||
from .config import BUILD_DIR
|
||||
|
||||
def which(tool):
|
||||
""" looks up the full path for @tool, returns None if not found
|
||||
|
@ -205,10 +204,10 @@ def get_qemu_img(test):
|
|||
|
||||
# If qemu-img has been built, use it, otherwise the system wide one
|
||||
# will be used.
|
||||
qemu_img = os.path.join(BUILD_DIR, 'qemu-img')
|
||||
qemu_img = test.build_file('qemu-img')
|
||||
if os.path.exists(qemu_img):
|
||||
return qemu_img
|
||||
qemu_img = which('qemu-img')
|
||||
if qemu_img is not None:
|
||||
return qemu_img
|
||||
test.skipTest(f"qemu-img not found in {BUILD_DIR} or '$PATH'")
|
||||
test.skipTest(f"qemu-img not found in build dir or '$PATH'")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue