From nobody Tue Feb 10 05:27:35 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=1680183678; cv=none; d=zohomail.com; s=zohoarc; b=IaozYuOacD7uG8VixIt6/lq0veaBfIOjaW89VwfzdubuCnIY6uR60OMdALzznD8MY9t3FMVrrIvxOxfAFGEi4hqjZ9Fn4CN6cWApKqulW7cM90WQslDsI2pIoin5iBqV0Z/EJFMlO3vg0YNIrN6Csf0rD8qGDWkN9xT63rirLEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680183678; 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=hNUPJ2fcOtG/Ffp7Tdv5zvPL9QYEwXPNtc4IIUaAhHE=; b=Hg8o07QyMrJlg5PY1vU2NVIOAh1Fqk+SYSZKRcNx0TqVl3mHy7wI/mAs7WLtSaJg92mhKrx3+HOhvbWSBSFdHrFqylbU/DkxEiYbcN3YfAWd1zF+vG82wS+XXavvVJDJZrWcSZ1DEtpsvxzmA1POdpar+zFQbAqrTDH+vXe6wXA= 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 1680183678702837.6547033463252; Thu, 30 Mar 2023 06:41:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-90-Ufp-PrBJOECB0vWFzKkREg-1; Thu, 30 Mar 2023 09:41:15 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E6AC03C0F1A9; Thu, 30 Mar 2023 13:41:12 +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 D38E84042AC0; Thu, 30 Mar 2023 13:41:12 +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 2654219465B7; Thu, 30 Mar 2023 13:39:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 30C9619472C0 for ; Thu, 30 Mar 2023 13:38:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1A0AB2166B36; Thu, 30 Mar 2023 13:38:38 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 824462166B33 for ; Thu, 30 Mar 2023 13:38:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680183677; 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=hNUPJ2fcOtG/Ffp7Tdv5zvPL9QYEwXPNtc4IIUaAhHE=; b=KlvZF7whTKj7Cdp1NRK1pQCg6vy45LRno/Ap4buYMvC+GaeUNUAGLLXmd4xnyepodHSwfj 7BZ1MZ2/24GbO/t3BOXdE0xJLJT7QcbT1ph5wXhGLGGLd9IejJm5dNQ65LT+hVjl2Za45d QDvliDGHPpa9SPYjiJFRf2+LhR0BjQk= X-MC-Unique: Ufp-PrBJOECB0vWFzKkREg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 11/31] tests: Remove 'vircapstest' Date: Thu, 30 Mar 2023 15:38:05 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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.1 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: 1680183935983100003 Content-Type: text/plain; charset="utf-8" Technically for the LXC capabilities lookup we don't have another test case, but given that it shares the implementation with qemu and thus the only thing we are missing out on is testing of filling of the fake capabilities which doesn't make sense testing. Remove vircapstest. Signed-off-by: Peter Krempa --- tests/meson.build | 14 ----- tests/vircapstest.c | 130 -------------------------------------------- 2 files changed, 144 deletions(-) delete mode 100644 tests/vircapstest.c diff --git a/tests/meson.build b/tests/meson.build index 6be806f4ae..11010ebc6c 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -249,19 +249,6 @@ if conf.has('WITH_QEMU') domaincapstest_link_whole +=3D [ test_utils_qemu_lib ] endif -vircapstest_link_with =3D [] -vircapstest_link_whole =3D [] -vircapstest_sources =3D [ 'vircapstest.c' ] -if conf.has('WITH_LXC') - vircapstest_link_with +=3D [ lxc_driver_impl_lib ] - vircapstest_link_whole +=3D [ test_utils_lxc_lib ] -endif -if conf.has('WITH_QEMU') - vircapstest_link_with +=3D [ qemu_driver_impl ] - vircapstest_link_whole +=3D [ test_utils_qemu_lib ] - vircapstest_sources +=3D [ qemu_dtrace_gen_objects ] -endif - tests +=3D [ { 'name': 'commandtest' }, { 'name': 'cputest', 'link_with': cputest_link_with, 'link_whole': cpute= st_link_whole }, @@ -285,7 +272,6 @@ tests +=3D [ { 'name': 'virauthconfigtest' }, { 'name': 'virbitmaptest' }, { 'name': 'virbuftest' }, - { 'name': 'vircapstest', 'sources': vircapstest_sources, 'link_with': vi= rcapstest_link_with, 'link_whole': vircapstest_link_whole }, { 'name': 'vircgrouptest' }, { 'name': 'virconftest' }, { 'name': 'vircryptotest' }, diff --git a/tests/vircapstest.c b/tests/vircapstest.c deleted file mode 100644 index 2101d35198..0000000000 --- a/tests/vircapstest.c +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (C) IBM Corp 2014 - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see - * . - * - */ - -#include - -#include "testutils.h" -#include "testutilslxc.h" -#include "capabilities.h" - - -#define VIR_FROM_THIS VIR_FROM_NONE - - -static bool G_GNUC_UNUSED -doCapsCompare(virCaps *caps, - int ostype, - virArch arch, - int domaintype, - const char *emulator, - const char *machinetype, - int expect_ostype, - virArch expect_arch, - int expect_domaintype, - const char *expect_emulator, - const char *expect_machinetype) -{ - bool ret =3D false; - virCapsDomainData *data =3D virCapabilitiesDomainDataLookup(caps, osty= pe, - arch, domaintype, emulator, machinetype); - - if (!data) - goto error; - - if (data->ostype !=3D expect_ostype) { - fprintf(stderr, "data->ostype=3D%s doesn't match expect_ostype=3D%= s\n", - virDomainOSTypeToString(data->ostype), - virDomainOSTypeToString(expect_ostype)); - goto error; - } - - if (data->arch !=3D expect_arch) { - fprintf(stderr, "data->arch=3D%s doesn't match expect_arch=3D%s\n", - virArchToString(data->arch), - virArchToString(expect_arch)); - goto error; - } - - if (data->domaintype !=3D expect_domaintype) { - fprintf(stderr, "data->domaintype=3D%s doesn't match " - "expect_domaintype=3D%s\n", - virDomainVirtTypeToString(data->domaintype), - virDomainVirtTypeToString(expect_domaintype)); - goto error; - } - - if (STRNEQ(data->emulator, expect_emulator)) { - fprintf(stderr, "data->emulator=3D%s doesn't match expect_emulator= =3D%s\n", - data->emulator, expect_emulator); - goto error; - } - - if (STRNEQ_NULLABLE(data->machinetype, expect_machinetype)) { - fprintf(stderr, "data->machinetype=3D%s doesn't match " - "expect_machinetype=3D%s\n", - NULLSTR(data->machinetype), NULLSTR(expect_machinetype)); - goto error; - } - - ret =3D true; - error: - VIR_FREE(data); - return ret; -} - -#define CAPSCOMP(o, a, d, e, m, fo, fa, fd, fe, fm) \ - if (!doCapsCompare(caps, o, a, d, e, m, fo, fa, fd, fe, fm)) \ - ret =3D -1; - -#ifdef WITH_LXC -static int -test_virCapsDomainDataLookupLXC(const void *data G_GNUC_UNUSED) -{ - int ret =3D 0; - g_autoptr(virCaps) caps =3D NULL; - - if (!(caps =3D testLXCCapsInit())) - return -1; - - CAPSCOMP(-1, VIR_ARCH_NONE, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_LXC, "/usr/libexec/libvirt_lxc", NULL); - CAPSCOMP(-1, VIR_ARCH_X86_64, VIR_DOMAIN_VIRT_NONE, NULL, NULL, - VIR_DOMAIN_OSTYPE_EXE, VIR_ARCH_X86_64, - VIR_DOMAIN_VIRT_LXC, "/usr/libexec/libvirt_lxc", NULL); - - return ret; -} -#endif /* WITH_LXC */ - -static int -mymain(void) -{ - int ret =3D 0; - -#ifdef WITH_LXC - if (virTestRun("virCapsDomainDataLookupLXC", - test_virCapsDomainDataLookupLXC, NULL) < 0) - ret =3D -1; -#endif /* WITH_LXC */ - - return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; -} - -VIR_TEST_MAIN(mymain) --=20 2.39.2