[PATCH] tests: Don't link vmx2xmltest with esx_lib

Michal Privoznik via Devel posted 1 patch 2 weeks, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/451fa2be3ae426a3f99787d243a6f5c5c62c9674.1763734221.git.mprivozn@redhat.com
tests/meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tests: Don't link vmx2xmltest with esx_lib
Posted by Michal Privoznik via Devel 2 weeks, 6 days ago
From: Michal Privoznik <mprivozn@redhat.com>

When reworking the vmx2xmltest to call esxParseVMXFileName() from
the ESX driver I also made the test link with the driver
statically. But the function then calls some other functions
which are mocked in vmx2xmlmock. Now, on many systems this works
just fine as the dynamic linker finds the mocked functions first.
But on Fedora 41 and Fedora 42 the dynamic linker resolves the
symbols to those from statically linked library rendering our
mock ineffective.

Just don't link in the esx_lib.

Fixes: f82d30307da8bea396a32dcab2ba9be5c3236b7c
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Green pipeline:

https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/2172179136

 tests/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/meson.build b/tests/meson.build
index 1f25f674f4..bb6ee6b4ee 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -550,7 +550,7 @@ endif
 
 if conf.has('WITH_VMX') and conf.has('WITH_ESX')
   tests += [
-    { 'name': 'vmx2xmltest', 'include': [ esx_inc_dir ], 'link_with': [ esx_lib ] },
+    { 'name': 'vmx2xmltest', 'include': [ esx_inc_dir ] },
     { 'name': 'xml2vmxtest' },
   ]
   mock_libs += [
-- 
2.51.0
Re: [PATCH] tests: Don't link vmx2xmltest with esx_lib
Posted by Ján Tomko via Devel 2 weeks, 6 days ago
On a Friday in 2025, Michal Privoznik via Devel wrote:
>From: Michal Privoznik <mprivozn@redhat.com>
>
>When reworking the vmx2xmltest to call esxParseVMXFileName() from
>the ESX driver I also made the test link with the driver
>statically. But the function then calls some other functions
>which are mocked in vmx2xmlmock. Now, on many systems this works
>just fine as the dynamic linker finds the mocked functions first.
>But on Fedora 41 and Fedora 42 the dynamic linker resolves the
>symbols to those from statically linked library rendering our
>mock ineffective.
>
>Just don't link in the esx_lib.
>
>Fixes: f82d30307da8bea396a32dcab2ba9be5c3236b7c
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
>
>Green pipeline:
>
>https://gitlab.com/MichalPrivoznik/libvirt/-/pipelines/2172179136
>
> tests/meson.build | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano