From nobody Tue Feb 10 20:47:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1689683353; cv=none; d=zohomail.com; s=zohoarc; b=D3GCVEXQ2fKsgX9VT3iutlch+8H4gzvDcPsyGME7Wad8rMbH6pxDS8uaOfowTMhEfjoW75o35SVGGNaLnlh7R+Od1VXZT7USCHkDGgXWuYfXeSCB3k3Dk1qXZOFUJaT/FX8Nc2QQGAKhne183UAmZ1/4MvzK2QnpifytBw4ToDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689683353; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FOvFNDcvSfyWWdMS/NEFYV1YKTe5KE+PkBjrmCApg1s=; b=h53vLkE0ThoXzyIxQ2jw76I0hzb1tPs4OH3zVTXO82IHsXxraQKffQeXvdrep3Df9BnwTIKTFBFHdiRekCwJpN065s9GrvO3FXArTRERkcmM8wB1hy7qnL5U76b5uBPIji/P3CIOnbhAGn4Bl/NodjbFMHbR9aYjApwRfqMRSp4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1689683353728678.3614217492116; Tue, 18 Jul 2023 05:29:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-sqr5dRA7MaaWcbeQLkDphw-1; Tue, 18 Jul 2023 08:29:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 899278D16A6; Tue, 18 Jul 2023 12:29:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF47E2166B25; Tue, 18 Jul 2023 12:29:06 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8A1D7194658F; Tue, 18 Jul 2023 12:29:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CF5631946594 for ; Tue, 18 Jul 2023 12:29:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F07A540C6CCC; Tue, 18 Jul 2023 12:28:59 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 96F4240C6F4C for ; Tue, 18 Jul 2023 12:28:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689683352; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FOvFNDcvSfyWWdMS/NEFYV1YKTe5KE+PkBjrmCApg1s=; b=VHEja10NvnyGd89X2ixebdPBzEwzphQaqOq5LqA+0Kjg4X1oV54fzP6SP+atYJEnnNwBv4 uUK6HIQ2ouzCeH/uu3DahlpdT6GgbZk88JnYbZFcuO2jiE5mAAv62IlRFYGA2TG5RT6lrw k/0lWjvysQEw9/rQj4ZuQofVFkQLf6E= X-MC-Unique: sqr5dRA7MaaWcbeQLkDphw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/2] meson: Annotate each test() with 'suite' Date: Tue, 18 Jul 2023 14:28:56 +0200 Message-ID: <137d134b4dd5d66d77d486f3e2c96bcc520cd07a.1689682680.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689683354293100001 Content-Type: text/plain; charset="utf-8"; x-default="true" A test case can be part of a test suite (just like we already have 'syntax-check'). This then allows developers to run only a subset of tests. For instance - when using valgrind test setup (`meson test -C _build/ --setup valgrind`) it makes zero sense to run syntax-check tests or other script based tests (e.g. check-augeas-*, check-remote_protocol, etc.). What does makes sense is to run compiled binaries. Strictly speaking, reaching that goal is as trivial as annotating only those compiled tests (declared in tests/meson.build) and running them selectively: meson test -C _build/ --setup valgrind --suite $TAG But it may be also desirable to run test scripts separately. Therefore, introduce two new tags: 'bin' for compiled tests, and 'script' for script based tests and annotate each test() accordingly. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/advanced-tests.rst | 2 +- docs/html/meson.build | 1 + docs/meson.build | 1 + src/access/meson.build | 1 + src/meson.build | 10 ++++++++++ tests/meson.build | 11 +++++++++-- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst index 370e24cc98..b9dae46c8a 100644 --- a/docs/advanced-tests.rst +++ b/docs/advanced-tests.rst @@ -16,7 +16,7 @@ by running =20 :: =20 - $ meson test --setup valgrind + $ meson test --setup valgrind --suite bin =20 `Valgrind `__ is a test that checks for memory management issues, such as leaks or use of uninitialized diff --git a/docs/html/meson.build b/docs/html/meson.build index 4d8d44d783..c0a666f4e1 100644 --- a/docs/html/meson.build +++ b/docs/html/meson.build @@ -126,4 +126,5 @@ test( '--nonet', '--noout', docs_html_paths, ], depends: docs_html_dep, + suite: 'script' ) diff --git a/docs/meson.build b/docs/meson.build index 70d271ec6e..b20ef1c926 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -360,4 +360,5 @@ test( meson.project_build_root() / 'docs' ], env: runutf8, + suite: 'script' ) diff --git a/src/access/meson.build b/src/access/meson.build index 07c703e8b5..e65f17c0a2 100644 --- a/src/access/meson.build +++ b/src/access/meson.build @@ -110,4 +110,5 @@ test( python3_prog, args: [ check_aclperms_prog.full_path(), access_perm_h, files('viraccess= perm.c') ], env: runutf8, + suite: 'script' ) diff --git a/src/meson.build b/src/meson.build index c2b882d464..28e4d0cc4e 100644 --- a/src/meson.build +++ b/src/meson.build @@ -923,6 +923,7 @@ if host_machine.system() =3D=3D 'linux' python3_prog, args: [ check_symfile_prog.full_path(), libvirt_syms, libvirt_lib ], env: runutf8, + suite: 'script' ) =20 if conf.has('WITH_REMOTE') @@ -931,6 +932,7 @@ if host_machine.system() =3D=3D 'linux' python3_prog, args: [ check_symfile_prog.full_path(), libvirt_admin_syms, libvirt_= admin_lib ], env: runutf8, + suite: 'script' ) endif endif @@ -944,6 +946,7 @@ test( files(sym_files, used_sym_files), ], env: runutf8, + suite: 'script' ) =20 test( @@ -955,6 +958,7 @@ test( libvirt_admin_private_syms, ], env: runutf8, + suite: 'script' ) =20 test( @@ -965,6 +969,7 @@ test( files('libvirt_public.syms'), libvirt_qemu_syms, libvirt_lxc_syms, ], env: runutf8, + suite: 'script' ) =20 test( @@ -974,6 +979,7 @@ test( check_drivername_prog.full_path(), libvirt_admin_public_syms, ], env: runutf8, + suite: 'script' ) =20 test( @@ -981,6 +987,7 @@ test( python3_prog, args: [ check_driverimpls_prog.full_path(), driver_source_files ], env: runutf8, + suite: 'script' ) =20 test( @@ -988,6 +995,7 @@ test( python3_prog, args: [ check_aclrules_prog.full_path(), files('remote/remote_protocol.x= '), stateful_driver_source_files ], env: runutf8, + suite: 'script' ) =20 if augparse_prog.found() @@ -1000,6 +1008,7 @@ if augparse_prog.found() '-I', data['builddir'], data['file'].full_path(), ], + suite: 'script' ) endforeach endif @@ -1020,6 +1029,7 @@ if pdwtags_prog.found() and cc.get_id() !=3D 'clang' ], env: runutf8, depends: [ lib ], + suite: 'script' ) endforeach endif diff --git a/tests/meson.build b/tests/meson.build index 0082446029..e6589ec555 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -595,7 +595,14 @@ foreach data : tests # default meson timeout timeout =3D 30 endif - test(data['name'], test_bin, env: tests_env, timeout: timeout, depends: = tests_deps) + test( + data['name'], + test_bin, + env: tests_env, + timeout: timeout, + depends: tests_deps, + suite: 'bin' + ) endforeach =20 =20 @@ -695,7 +702,7 @@ endif =20 foreach name : test_scripts script =3D find_program(name) - test(name, script, env: tests_env) + test(name, script, env: tests_env, suite: 'script') endforeach =20 testenv =3D runutf8 --=20 2.41.0 From nobody Tue Feb 10 20:47:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1689683355; cv=none; d=zohomail.com; s=zohoarc; b=nhp/l/eVjC1KCWYA8+cIhTfgAqM7NratluHMIQEc5ayu2r1q8LR+ObhM0QYKHpwZBD3wRAZPQtHhwOxcltdD83UyN9lm49/ShWdDD30aEebcK4dKKBmaHhbVSviveRDmFTOTZc4DC52xo3iHNxfPHHqfqBiLdB0CD8jFzVUxv58= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689683355; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oj+/H9AAeVU0oG9vXSPlGFuP0kwC265ViDLgsNSn/SQ=; b=LlWD9DrtDVOuOOEyr7NOVG2GdE3gGjOl5m3/NY71cVi1Szxm6gGCE0EG/MT3ALtoISMafKn/gGhj8N0x5TBk+txCvNn8MH3RNlDmp7rPTq5xXOqSEjUgoiTgC7/5pFqaK2r4wHPsoaqnRyD9WvVcI0PAoe6+39lmHII1h8zTfCs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1689683355040383.06483268163197; Tue, 18 Jul 2023 05:29:15 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-524-wi72AXjsOXymdQrNGYS0tg-1; Tue, 18 Jul 2023 08:29:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D31418870D9; Tue, 18 Jul 2023 12:29:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CDE3C57969; Tue, 18 Jul 2023 12:29:08 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 138B11946A44; Tue, 18 Jul 2023 12:29:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CF017194658F for ; Tue, 18 Jul 2023 12:29:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8A2D34067A22; Tue, 18 Jul 2023 12:29:00 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 31FF040C6CCD for ; Tue, 18 Jul 2023 12:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689683354; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oj+/H9AAeVU0oG9vXSPlGFuP0kwC265ViDLgsNSn/SQ=; b=ALFUYzu8TYRL8EddDzLTHiOVAMo9T5Dr8qJWD1YnlK8e8fHtB0UrBJaYM5XXQZYtQIsBZh qY78CzvjLjuFBfdQbuepkrM3mFV+jf1D12IIWrRtan10cMwCw2ViOwv8sEBeC03bMqyklY wYLN9LQtfodqnOV0q/Zd9IHgP/WnD9A= X-MC-Unique: wi72AXjsOXymdQrNGYS0tg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/2] tests: Refresh valgrind suppressions Date: Tue, 18 Jul 2023 14:28:57 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689683356430100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Since nobody is expected to run valgrind over scripts now, we can drop plenty of suppressions. Also, there are some old ones that no longer exist and new ones, that are not covered. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- tests/.valgrind.supp | 188 ++++++++++--------------------------------- 1 file changed, 41 insertions(+), 147 deletions(-) diff --git a/tests/.valgrind.supp b/tests/.valgrind.supp index f78b3b1f72..9ccefab0df 100644 --- a/tests/.valgrind.supp +++ b/tests/.valgrind.supp @@ -1,163 +1,57 @@ { - bashMemoryLeak1 + glib-memory-leak1 Memcheck:Leak - fun:malloc - fun:xmalloc - ... - fun:execute_command_internal + match-leak-kinds: possible + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.34 + fun:g_system_thread_new ... - obj:*/bin/bash + fun:g_task_get_type_once + fun:g_task_get_type + fun:_g_dbus_initialize.part.0 + fun:g_dbus_error_new_for_dbus_error + fun:wrap_g_dbus_connection_call_sync } { - bashMemoryLeak2 + glib-memory-leak2 Memcheck:Leak + match-leak-kinds: possible fun:malloc - fun:xmalloc + fun:tsearch + fun:__add_to_environ + fun:setenv + fun:g_setenv ... - fun:yyparse - fun:parse_command - fun:read_command - ... - obj:*/bin/bash + fun:virTestMain + fun:main } { - bashMemoryLeak3 + commandtest Memcheck:Leak - fun:malloc - fun:xmalloc - fun:array_create - fun:array_copy - fun:run_exit_trap - fun:exit_shell - ... - obj:*/bin/bash + match-leak-kinds: possible + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.34 + fun:virThreadCreateFull + fun:virCommandRunAsync + fun:test21 + fun:virTestRun + fun:mymain + fun:virTestMain + fun:main } { - bashMemoryLeak4 + eventtest Memcheck:Leak - match-leak-kinds: definite - fun:malloc - fun:xmalloc - fun:set_default_locale + match-leak-kinds: possible + fun:calloc + fun:allocate_dtv + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.34 + fun:mymain + fun:virTestMain fun:main - ... - obj:*/bin/bash -} -# -# Failure seen in /usr/lib64/ld-2.15.so -# -{ - dlInitMemoryLeak1 - Memcheck:Leak - fun:?alloc - ... - fun:call_init.part.0 - fun:_dl_init - ... - obj:*/lib*/ld-2.*so* -} -# -# Failure seen in -# p11_kit_registered_module_to_name: /usr/lib64/libp11-kit.so.0.0.0 -# gnutls_pkcs11_init: /usr/lib64/libgnutls.so.26.22.4 -# -{ - gnutlsInitMemoryLeak - Memcheck:Leak - fun:malloc - fun:strdup - fun:p11_kit_registered_module_to_name - fun:gnutls_pkcs11_init - fun:gnutls_global_init - ... - obj:*/lib*/libc-2.*so* -} -# -# Failure seen in eventtest, qemumonitorjsontest, qemuhotplugtest, -# qemuagenttest -# -{ - dlAllocateTlsMemoryLeak - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create* - ... - fun:mymain - fun:virtTestMain - ... - obj:*/lib*/libc-2.*so* -} -# -# commandtest validates the various threaded commands. The -# virThreadCreate() routine allocates and passes args to the -# new thread which now owns the 'args' and thus cannot be free'd -# -{ - commandtestLeak1 - Memcheck:Leak - fun:calloc - fun:virAlloc - fun:virThreadCreate - fun:mymain - fun:virtTestMain -} -# -# The Error code requires static memory that is never free'd -# for thread local storage to store error message/data -# -{ - commandtestLeak2 - Memcheck:Leak - fun:calloc - fun:virAlloc - ... - fun:vir*LastError* - fun:virEventRunDefaultImpl - fun:virCommandThreadWorker - fun:virThreadHelper - fun:start_thread - fun:clone -} -# -# Some of the commandtests (test0, test1, test4, & test18) cause the -# following traceback although it appears the memory is properly freed -# -{ - commandtestLeak3 - Memcheck:Leak - fun:calloc - fun:virAllocN - fun:virEventPollRunOnce - fun:virEventRunDefaultImpl - fun:virCommandThreadWorker - fun:virThreadHelper - fun:start_thread - fun:clone -} -# -# seclabeltest relies on 'selabel_close' which is not in libvirt -# -{ - seclabeltestcond1 - Memcheck:Cond - obj:/usr/lib64/libselinux.so.1 - fun:selabel_close - fun:virSecuritySELinuxSecurityDriverClose - fun:virSecurityManagerDispose - fun:virObjectUnref - fun:main -} -# -# types registered with GLib are never freed -# -{ - glibTypeRegisterLeak - Memcheck:Leak - match-leak-kinds: possible - ... - fun:g_realloc - obj:*/lib*/libgobject* - fun:g_type_register_static - ... } --=20 2.41.0