From: Radoslaw Jablonski Date: Wed, 2 May 2018 07:48:34 +0000 (+0100) Subject: virt unit tests: Add valgrind.suppress with libnl1 leak definition X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=56322029e2c92fbe29103d0bcc50f544026899c7;p=collectd.git virt unit tests: Add valgrind.suppress with libnl1 leak definition Libnl-1 is used by libvirt on older systems (e.g. debian wheezy) and unfortunately it has memory leaks that cannot be fixed from collectd side - virt unit tests were failing on platforms with libnl1 because of those leaks. Valgrind.suppress file is used to pass definitions for leaks that cannot be fixed and now virt unit tests can be run without any problems on every platform - memory leaks are still validated and the only difference is that libnl1 leaks are ignored during valgrind check. Change-Id: I5fc423402f7b89e4e43fb896f73cba89eea36226 Signed-off-by: Radoslaw Jablonski --- diff --git a/Makefile.am b/Makefile.am index dfd4b5ec..2e8ad507 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1758,11 +1758,7 @@ virt_la_CFLAGS = $(AM_CFLAGS) \ virt_la_LDFLAGS = $(PLUGIN_LDFLAGS) virt_la_LIBADD = libignorelist.la $(BUILD_WITH_LIBVIRT_LIBS) $(BUILD_WITH_LIBXML2_LIBS) -# TODO: enable once we support only modern libvirts which depends on libnl-3 -# the libvirt on wheezy is linked in libnl v1, and there is a small leak here, -# triggered by the library initialization. There are no means to avoid it, -# and libvirt switched to libnl3 anyway -test_plugin_virt_SOURCES = src/virt_test.c +test_plugin_virt_SOURCES = src/virt_test.c test_plugin_virt_CPPFLAGS = $(AM_CPPFLAGS) \ $(BUILD_WITH_LIBVIRT_CPPFLAGS) $(BUILD_WITH_LIBXML2_CFLAGS) test_plugin_virt_LDFLAGS = $(PLUGIN_LDFLAGS) \ diff --git a/src/valgrind.suppress b/src/valgrind.suppress new file mode 100644 index 00000000..f4c3f343 --- /dev/null +++ b/src/valgrind.suppress @@ -0,0 +1,7 @@ +{ + libnl1_virt_initialization_unpreventable_leak + Memcheck:Leak + ... + obj:*libnl.so.1.* + ... +} \ No newline at end of file