On Thu, Dec 12, 2024 at 10:42:49AM +0100, Thomas Huth wrote:
> On 11/12/2024 18.26, Daniel P. Berrangé wrote:
> > This removes direct access of the 'BUILD_DIR' variable.
> > 
> > Reviewed-by: Thomas Huth <th...@redhat.com>
> > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
> > ---
> ...
> > diff --git a/tests/functional/test_virtio_gpu.py 
> > b/tests/functional/test_virtio_gpu.py
> > index 7654421e6b..630569bff8 100755
> > --- a/tests/functional/test_virtio_gpu.py
> > +++ b/tests/functional/test_virtio_gpu.py
> > @@ -6,7 +6,6 @@
> >   # later.  See the COPYING file in the top-level directory.
> > -from qemu_test import BUILD_DIR
> >   from qemu_test import QemuSystemTest, Asset
> >   from qemu_test import wait_for_console_pattern
> >   from qemu_test import exec_command_and_wait_for_pattern
> > @@ -18,12 +17,8 @@
> >   import subprocess
> > -def pick_default_vug_bin():
> > -    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)
> > +def pick_default_vug_bin(test):
> > +    bld_dir_path = test.build_file(relative_path)
> >       if is_readable_executable_file(bld_dir_path):
> >           return bld_dir_path
> 
> FYI, while testing, I noticed that this is failing now:
> 
> Traceback (most recent call last):
>   File ".../tests/functional/test_virtio_gpu.py", line 84, in 
> test_vhost_user_vga_virgl
>     vug = pick_default_vug_bin(self)
>           ^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File ".../tests/functional/test_virtio_gpu.py", line 21, in 
> pick_default_vug_bin
>     bld_dir_path = test.build_file(relative_path)
>                                    ^^^^^^^^^^^^^
> NameError: name 'relative_path' is not defined

I'll add the following

-    bld_dir_path = test.build_file(relative_path)
+    bld_dir_path = test.build_file("contrib", "vhost-user-gpu", 
"vhost-user-gpu")

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to