On Wed, Feb 26, 2025 at 02:03:25PM +0000, Alex Bennée wrote:
> From: Philippe Mathieu-Daudé <phi...@linaro.org>
> 
> Not all platforms use the '.so' suffix for shared libraries,
> which is how plugins are built. Use the recently introduced
> dso_suffix() helper to get the proper host suffix.
> 
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2804
> Suggested-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
> Suggested-by: Daniel P. Berrangé <berra...@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
> Reviewed-by: Pierrick Bouvier <pierrick.bouv...@linaro.org>
> Reviewed-by: Thomas Huth <th...@redhat.com>
> Message-Id: <20250220080215.49165-4-phi...@linaro.org>
> Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
> ---
>  tests/functional/test_aarch64_tcg_plugins.py | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/functional/test_aarch64_tcg_plugins.py 
> b/tests/functional/test_aarch64_tcg_plugins.py
> index 7e8beacc83..5736b60545 100755
> --- a/tests/functional/test_aarch64_tcg_plugins.py
> +++ b/tests/functional/test_aarch64_tcg_plugins.py
> @@ -13,10 +13,11 @@
>  
>  import tempfile
>  import mmap
> +import os
>  import re
>  
>  from qemu.machine.machine import VMLaunchFailure
> -from qemu_test import LinuxKernelTest, Asset
> +from qemu_test import LinuxKernelTest, Asset, dso_suffix
>  
>  
>  class PluginKernelBase(LinuxKernelTest):
> @@ -62,6 +63,10 @@ class PluginKernelNormal(PluginKernelBase):
>          ('https://storage.tuxboot.com/20230331/arm64/Image'),
>          'ce95a7101a5fecebe0fe630deee6bd97b32ba41bc8754090e9ad8961ea8674c7')
>  
> +    def plugin_file(self, plugin_name):
> +        sfx = dso_suffix()
> +        return os.path.join('tests', 'tcg', 'plugins', 
> f'{plugin_name}.{sfx}')

General purpose helper functions shouldn't go in the test cases files.
This it better placed in tests/functional/qemu_test/testcase.py, alongside
all the other path construction helper functions.


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