On Thu, Jul 16, 2020 at 11:58:37 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
tests/Makefile.am | 14 +-------------
tests/meson.build | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 13 deletions(-)
[...]
diff --git a/tests/meson.build b/tests/meson.build
index 5cbd3cd2077..fa116a0e249 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -170,3 +170,20 @@ test_file_wrapper_lib = static_library(
[ 'virfilewrapper.c' ],
dependencies: [ tests_dep ],
)
+
+
+# build helpers used by tests
+
+# Must not link to any libvirt modules - libc only otherwise external
+# libraries might unexpectedly leak file descriptors into commandhelper
+# invalidating the test logic assumptions.
This didn't work out:
$ ldd commandtest
linux-vdso.so.1 (0x00007ffd24939000)
libvirt.so.0 => /home/pipo/build/libvirt/gcc/tests/./../src/libvirt.so.0
(0x00007feeabbf3000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007feeabaa8000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feeaba8d000)
libc.so.6 => /lib64/libc.so.6 (0x00007feeab8c3000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007feeab8be000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007feeab865000)
libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007feeab67f000)
libxml2.so.2 => /lib64/libxml2.so.2 (0x00007feeab50f000)
libacl.so.1 => /lib64/libacl.so.1 (0x00007feeab504000)
libaudit.so.1 => /lib64/libaudit.so.1 (0x00007feeab4d8000)
libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007feeab4d0000)
libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007feeab479000)
libgnutls.so.30 => /lib64/libgnutls.so.30 (0x00007feeab28b000)
libnl-3.so.200 => /lib64/libnl-3.so.200 (0x00007feeab267000)
libnuma.so.1 => /lib64/libnuma.so.1 (0x00007feeab259000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007feeab22c000)
libyajl.so.2 => /lib64/libyajl.so.2 (0x00007feeab220000)
libssh2.so.1 => /lib64/libssh2.so.1 (0x00007feeab1de000)
libssh.so.4 => /lib64/libssh.so.4 (0x00007feeab16a000)
libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007feeab14a000)
libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007feeab119000)
libcurl.so.4 => /lib64/libcurl.so.4 (0x00007feeab085000)
libwsman.so.1 => /lib64/libwsman.so.1 (0x00007feeab04b000)
libwsman_client.so.4 => /lib64/libwsman_client.so.4 (0x00007feeab03d000)
libwsman_curl_client_transport.so.1 => /lib64/libwsman_curl_client_transport.so.1
(0x00007feeab032000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007feeab02b000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feeab009000)
/lib64/ld-linux-x86-64.so.2 (0x00007feeac0b2000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007feeaaf90000)
libffi.so.6 => /lib64/libffi.so.6 (0x00007feeaaf85000)
libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007feeaaf7d000)
libz.so.1 => /lib64/libz.so.1 (0x00007feeaaf63000)
libmount.so.1 => /lib64/libmount.so.1 (0x00007feeaaf03000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007feeaaee9000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007feeaaebf000)
libm.so.6 => /lib64/libm.so.6 (0x00007feeaad79000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007feeaad6f000)
libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007feeaacb8000)
libp11-kit.so.0 => /lib64/libp11-kit.so.0 (0x00007feeaab88000)
libidn2.so.0 => /lib64/libidn2.so.0 (0x00007feeaab66000)
libunistring.so.2 => /lib64/libunistring.so.2 (0x00007feeaa9e1000)
libtasn1.so.6 => /lib64/libtasn1.so.6 (0x00007feeaa9cb000)
libnettle.so.7 => /lib64/libnettle.so.7 (0x00007feeaa98c000)
libhogweed.so.5 => /lib64/libhogweed.so.5 (0x00007feeaa95a000)
libgmp.so.10 => /lib64/libgmp.so.10 (0x00007feeaa8c3000)
libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007feeaa82a000)
libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007feeaa793000)
libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007feeaa4a6000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007feeaa44d000)
libcrypt.so.2 => /lib64/libcrypt.so.2 (0x00007feeaa412000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007feeaa327000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007feeaa30e000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007feeaa307000)
libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007feeaa2db000)
libpsl.so.5 => /lib64/libpsl.so.5 (0x00007feeaa2c6000)
libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007feeaa274000)
liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007feeaa263000)
libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007feeaa254000)
libblkid.so.1 => /lib64/libblkid.so.1 (0x00007feeaa201000)
librt.so.1 => /lib64/librt.so.1 (0x00007feeaa1f4000)
liblz4.so.1 => /lib64/liblz4.so.1 (0x00007feeaa1d3000)
libgcrypt.so.20 => /lib64/libgcrypt.so.20 (0x00007feeaa0b2000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007feeaa0a0000)
libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007feeaa099000)
libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007feeaa074000)
libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007feeaa050000)
Pre-meson:
$ ldd commandhelper
linux-vdso.so.1 (0x00007ffc6719f000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fae36bbd000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fae36b9b000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fae36b94000)
libc.so.6 => /lib64/libc.so.6 (0x00007fae369ca000)
/lib64/ld-linux-x86-64.so.2 (0x00007fae36be4000)