diff options
| author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-03-04 22:24:17 +0000 |
|---|---|---|
| committer | Alex Bennée <alex.bennee@linaro.org> | 2025-03-10 10:30:00 +0000 |
| commit | ed557cc544b2162eec8ec977af65cdd09277d44a (patch) | |
| tree | 5a4722a0185f985e924f1d48e97e56f3816f3e15 /tests/functional/qemu_test/testcase.py | |
| parent | 3a7b9054b8d761e61628e67e90b118d05b4a4697 (diff) | |
| download | focaccia-qemu-ed557cc544b2162eec8ec977af65cdd09277d44a.tar.gz focaccia-qemu-ed557cc544b2162eec8ec977af65cdd09277d44a.zip | |
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>
Diffstat (limited to 'tests/functional/qemu_test/testcase.py')
| -rw-r--r-- | tests/functional/qemu_test/testcase.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py index 058bf270ec..50d232a7c6 100644 --- a/tests/functional/qemu_test/testcase.py +++ b/tests/functional/qemu_test/testcase.py @@ -27,7 +27,7 @@ from qemu.utils import kvm_available, tcg_available from .archive import archive_extract from .asset import Asset -from .config import BUILD_DIR +from .config import BUILD_DIR, dso_suffix from .uncompress import uncompress @@ -183,6 +183,16 @@ class QemuBaseTest(unittest.TestCase): def log_file(self, *args): return str(Path(self.outputdir, *args)) + ''' + @params plugin name + + Return the full path to the plugin taking into account any host OS + specific suffixes. + ''' + def plugin_file(self, plugin_name): + sfx = dso_suffix() + return os.path.join('tests', 'tcg', 'plugins', f'{plugin_name}.{sfx}') + def assets_available(self): for name, asset in vars(self.__class__).items(): if name.startswith("ASSET_") and type(asset) == Asset: |