@@ -127,8 +127,8 @@ def setUp(self, bin_prefix):
self.arch = self.qemu_bin.split('-')[-1]
self.socketdir = None
- self.outputdir = os.path.join(BUILD_DIR, 'tests', 'functional',
- self.arch, self.id())
+ self.outputdir = self.build_file('tests', 'functional',
+ self.arch, self.id())
self.workdir = os.path.join(self.outputdir, 'scratch')
os.makedirs(self.workdir, exist_ok=True)
@@ -14,7 +14,7 @@
import os
import logging
-from qemu_test import (BUILD_DIR, QemuSystemTest, Asset, exec_command,
+from qemu_test import (QemuSystemTest, Asset, exec_command,
wait_for_console_pattern, get_qemu_img, run_cmd)
@@ -52,8 +52,8 @@ def test_alpine_virt_tcg_gic_max(self):
"mte=on,"
"gic-version=max,iommu=smmuv3")
self.vm.add_args("-smp", "2", "-m", "1024")
- self.vm.add_args('-bios', os.path.join(BUILD_DIR, 'pc-bios',
- 'edk2-aarch64-code.fd'))
+ self.vm.add_args('-bios', self.build_file('pc-bios',
+ 'edk2-aarch64-code.fd'))
self.vm.add_args("-drive", f"file={iso_path},media=cdrom,format=raw")
self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
self.vm.add_args('-object', 'rng-random,id=rng0,filename=/dev/urandom')
@@ -6,8 +6,7 @@
# later. See the COPYING file in the top-level directory.
-from qemu_test import (BUILD_DIR, QemuSystemTest, Asset,
- wait_for_console_pattern,
+from qemu_test import (QemuSystemTest, Asset, wait_for_console_pattern,
exec_command_and_wait_for_pattern,
is_readable_executable_file)
from qemu.utils import kvm_available
@@ -17,12 +16,12 @@
import subprocess
-def pick_default_vug_bin():
+def pick_default_vug_bin(test):
relative_path = "./contrib/vhost-user-gpu/vhost-user-gpu"
if is_readable_executable_file(relative_path):
return relative_path
- bld_dir_path = os.path.join(BUILD_DIR, relative_path)
+ bld_dir_path = test.build_file(relative_path)
if is_readable_executable_file(bld_dir_path):
return bld_dir_path
@@ -85,7 +84,7 @@ def test_vhost_user_vga_virgl(self):
# FIXME: should check presence of vhost-user-gpu, virgl, memfd etc
self.require_accelerator('kvm')
- vug = pick_default_vug_bin()
+ vug = pick_default_vug_bin(self)
if not vug:
self.skipTest("Could not find vhost-user-gpu")
This removes direct access of the 'BUILD_DIR' variable. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- tests/functional/qemu_test/testcase.py | 4 ++-- tests/functional/test_aarch64_virt.py | 6 +++--- tests/functional/test_virtio_gpu.py | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-)