From nobody Mon Feb 9 18:45:11 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1711193831484207.44455137788407; Sat, 23 Mar 2024 04:37:11 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 553A11926; Sat, 23 Mar 2024 07:37:10 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 06C5E2146; Sat, 23 Mar 2024 07:33:17 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 6FD7A213C; Sat, 23 Mar 2024 07:33:09 -0400 (EDT) Received: from mx1.osci.io (polly.osci.io [8.43.85.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id C3E6F1AC8 for ; Sat, 23 Mar 2024 07:32:51 -0400 (EDT) Received: by mx1.osci.io (Postfix, from userid 994) id D09F0223F5; Fri, 22 Mar 2024 13:56:52 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by mx1.osci.io (Postfix) with ESMTPS id 58E6B223EF for ; Fri, 22 Mar 2024 13:56:52 -0400 (EDT) Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-284-mbjabECcNVi-1TlajX_78g-1; Fri, 22 Mar 2024 13:56:50 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CB11538012CB for ; Fri, 22 Mar 2024 17:56:49 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.6]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44782492BD0 for ; Fri, 22 Mar 2024 17:56:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: mbjabECcNVi-1TlajX_78g-1 From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 32/35] tests: Re-implement '(virsh|virt-admin)-self-test' directly in meson Date: Fri, 22 Mar 2024 18:56:10 +0100 Message-ID: <26b57dfa235032a47c5b034c4274a8f8c0977aad.1711129973.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: IODMYHMQRAFAHR3E62EWK5Y6YPYGN2ZX X-Message-ID-Hash: IODMYHMQRAFAHR3E62EWK5Y6YPYGN2ZX X-MailFrom: SRS0=Xa5W=K4=redhat.com=pkrempa@osci.io X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1711193832399100001 The self-test command for both virsh and virt-admin is self contained and directly reports success, thus we don't actually need to run a shell wrapper around it. Signed-off-by: Peter Krempa --- tests/meson.build | 16 +++++++++++-- tests/virsh-self-test | 48 -------------------------------------- tests/virt-admin-self-test | 1 - tools/meson.build | 4 ++-- 4 files changed, 16 insertions(+), 53 deletions(-) delete mode 100755 tests/virsh-self-test delete mode 120000 tests/virt-admin-self-test diff --git a/tests/meson.build b/tests/meson.build index 68f7635df9..8ccc63b3a6 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -619,6 +619,20 @@ test( suite: 'script', ) +# vsh based client self-test, which can be run directly from meson +test('virsh self-test', + virsh_prog, + args: [ '-q', '-c', 'test:///default', 'self-test' ], + suite: 'bin', +) + +if conf.has('WITH_REMOTE') + test('virt-admin self-test', + virt_admin_prog, + args: [ '-q', 'self-test' ], + suite: 'bin', + ) +endif # helpers: # each entry is a dictionary with following items: @@ -690,9 +704,7 @@ if conf.has('WITH_LIBVIRTD') test_scripts +=3D [ 'libvirtd-fail', 'virsh-auth', - 'virsh-self-test', 'virsh-uriprecedence', - 'virt-admin-self-test', ] if conf.has('WITH_SECDRIVER_APPARMOR') diff --git a/tests/virsh-self-test b/tests/virsh-self-test deleted file mode 100755 index 22396bceee..0000000000 --- a/tests/virsh-self-test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# run virsh self-test to make sure command option structures are valid - -# Copyright (C) 2016 Red Hat, Inc. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see -# . - -. "$(dirname $0)/test-lib.sh" - -fail=3D0 - -basename=3D$(basename $0) - -if test "x$basename" =3D "xvirsh-self-test" ; then - binary=3Dvirsh - extra_args=3D"-c test:///default" -elif test "x$basename" =3D "xvirt-admin-self-test" ; then - binary=3Dvirt-admin - extra_args=3D"" -else - echo "Unknown binary: $basename"; - exit 1 -fi - -test_intro "$0" -$abs_top_builddir/tools/${binary} ${extra_args} self-test > /dev/null -status=3D$? -test_result 1 "$0" ${status} - -if test "${status}" !=3D "0" ; then - fail=3D1 -fi - -test_final $counter $fail - -(exit $fail); exit $fail diff --git a/tests/virt-admin-self-test b/tests/virt-admin-self-test deleted file mode 120000 index d4ad624a04..0000000000 --- a/tests/virt-admin-self-test +++ /dev/null @@ -1 +0,0 @@ -./virsh-self-test \ No newline at end of file diff --git a/tools/meson.build b/tools/meson.build index c72f760a1d..15be557dfe 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -155,7 +155,7 @@ else virsh_icon_res =3D [] endif -executable( +virsh_prog =3D executable( 'virsh', [ 'virsh.c', @@ -209,7 +209,7 @@ executable( ) if conf.has('WITH_REMOTE') - executable( + virt_admin_prog =3D executable( 'virt-admin', [ 'virt-admin.c', --=20 2.44.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org