@@ -27,7 +27,7 @@
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
@@ -184,6 +184,16 @@ def scratch_file(self, *args):
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:
@@ -13,6 +13,7 @@
import tempfile
import mmap
+import os
import re
from qemu.machine.machine import VMLaunchFailure
@@ -74,7 +75,7 @@ def test_aarch64_virt_insn(self):
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 @@ def test_aarch64_virt_insn_icount(self):
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'))