tests/functional: Allow running TCG plugins tests on non-Linux/BSD hosts

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.bouvier@linaro.org>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20250220080215.49165-4-philmd@linaro.org>
[AJB: moved plugin_file into testcase.py]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250304222439.2035603-11-alex.bennee@linaro.org>
This commit is contained in:
Philippe Mathieu-Daudé 2025-03-04 22:24:17 +00:00 committed by Alex Bennée
parent 3a7b9054b8
commit ed557cc544
2 changed files with 14 additions and 3 deletions

View file

@ -13,6 +13,7 @@
import tempfile
import mmap
import os
import re
from qemu.machine.machine import VMLaunchFailure
@ -74,7 +75,7 @@ class PluginKernelNormal(PluginKernelBase):
suffix=".log")
self.run_vm(kernel_path, kernel_command_line,
"tests/tcg/plugins/libinsn.so", plugin_log.name,
self.plugin_file('libinsn'), plugin_log.name,
console_pattern)
with plugin_log as lf, \
@ -100,7 +101,7 @@ class PluginKernelNormal(PluginKernelBase):
suffix=".log")
self.run_vm(kernel_path, kernel_command_line,
"tests/tcg/plugins/libinsn.so", plugin_log.name,
self.plugin_file('libinsn'), plugin_log.name,
console_pattern,
args=('-icount', 'shift=1'))