From patchwork Wed Mar 6 23:36:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 159770 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp6773891jad; Wed, 6 Mar 2019 15:37:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwRoiOSKVPgTpgPIr6sWSrweqWr+Ap5Yi71nAAm0UBplhGPMJrNzhiBifu91Sh4rjvX/f+B X-Received: by 2002:a0c:88c9:: with SMTP id 9mr8339251qvo.178.1551915458423; Wed, 06 Mar 2019 15:37:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551915458; cv=none; d=google.com; s=arc-20160816; b=V2L8ofweQfQAVA3WQESOkiQle1kMyuUmmdimH8nppO9BCgiY60X3Cnl1g60By3ZcWu FuE47Mbi1z+bggfBw7Oc9dUb5d8s+PIm8FymwwA9/5c2g0ykCinVer/+3aLpdPufxxji bF7gGomk8BhNwxYp04Psm3PfV77xmoyyls++sSChEg4kSfGKvytNfEKKclB9TeXq2CPn 8CODKHSV3RZIocFPG8x+lJ94HRLAWudhM0mSLDA3vZi6Nmd0Z0x9pan2kzkZVRcsj6MD /ISdO+FIGJYvRPHkHGVZ3p0qyXcQERRGfB5rWXNEKXa1rM+LKX5pOKP8Cg72QYnLddzW hO+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=WBC4v+d85CDF4zEZ5Sk7KGhJEUEwkRCK8xrcayvo1aU=; b=EbFs2X1dQOUZylPvNa1udeEOQM7N3SBjkC1ZG87FPiU5GuEWjDm8Ot2dPxEhHCgyWJ RhshIt8nEserow+GRzy6FG06lDQc/vD6xCUf91PBslQJhS06zTJY16xeCOsct09l8+S6 AXsHH/E68jvqLLrUfv7omL/h6q31L54IPkYjwbubZGzF6pr+fZKcYNWrQndnqmZhtWlM tr1yr3LS292tlRZ2N4t0RbMdn51GgqG53zOLBk/VTWIBw4zpSK0mXyOzffq6dzaIf6Ll CParFnOaWEPtbjpqXRAlc6S4VEXChmaQCOnTJJF3tSaRg2hMvad1ext4cB8afr9YkLQ1 Kp8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id t22si1885146qtj.195.2019.03.06.15.37.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 15:37:38 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A79180F81; Wed, 6 Mar 2019 23:37:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB59E1900E; Wed, 6 Mar 2019 23:37:36 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9A164181A138; Wed, 6 Mar 2019 23:37:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26NbH5w005173 for ; Wed, 6 Mar 2019 18:37:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1C28D1001DFB; Wed, 6 Mar 2019 23:37:17 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-104.rdu2.redhat.com [10.10.121.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id AB3611001DE2; Wed, 6 Mar 2019 23:37:16 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Wed, 6 Mar 2019 18:36:52 -0500 Message-Id: <3e1a0a53d59172fa656e07f28c9232cf69d1e67b.1551914794.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/16] tests: domcaps: Remove 'full' test X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 06 Mar 2019 23:37:37 +0000 (UTC) The 'full' test verifies the output of a virDomainCapsPtr built by hand. It has the following problems: The domcaps test suite nowadays has 3 hypervisor driver implementations which should give us plenty of opportunity to get full domcaps coverage. I don't think this test has much value. And it has the following issues: - Requires manual intervention to test new domcaps XML, which is easy to miss, for example gic bits aren't covered there. - The SET_ALL_BITS trick it uses to fill in enums will output values that are never reported by any driver implementation (strings like 'default') Let's remove it Signed-off-by: Cole Robinson --- tests/domaincapsschemadata/full.xml | 123 ---------------------------- tests/domaincapstest.c | 73 ----------------- 2 files changed, 196 deletions(-) delete mode 100644 tests/domaincapsschemadata/full.xml -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml deleted file mode 100644 index 28263466a4..0000000000 --- a/tests/domaincapsschemadata/full.xml +++ /dev/null @@ -1,123 +0,0 @@ - - /bin/emulatorbin - kvm - my-machine-type - x86_64 - - - - - /foo/bar - /tmp/my_path - - rom - pflash - - - default - yes - no - - - - - - - host - CPU Vendorrr - - - Model1 - Model2 - Model3 - - - - - - disk - cdrom - floppy - lun - - - ide - fdc - scsi - virtio - xen - usb - uml - sata - sd - - - default - virtio - virtio-transitional - virtio-non-transitional - - - - - sdl - vnc - rdp - desktop - spice - egl-headless - - - - - - subsystem - capabilities - - - default - mandatory - requisite - optional - - - usb - pci - scsi - scsi_host - mdev - - - storage - misc - net - - - default - kvm - vfio - xen - - - - - - - - - - diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index 02f33d9f00..1aa8c023a2 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -24,9 +24,6 @@ #define VIR_FROM_THIS VIR_FROM_NONE -#define SET_ALL_BITS(x) \ - memset(&(x.values), 0xff, sizeof(x.values)) - static int ATTRIBUTE_SENTINEL fillStringValues(virDomainCapsStringValuesPtr values, ...) { @@ -48,67 +45,6 @@ fillStringValues(virDomainCapsStringValuesPtr values, ...) return ret; } -static int -fillAllCaps(virDomainCapsPtr domCaps) -{ - virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsLoaderPtr loader = &os->loader; - virDomainCapsCPUPtr cpu = &domCaps->cpu; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; - virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; - virDomainCapsDeviceVideoPtr video = &domCaps->video; - virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; - virCPUDef host = { - .type = VIR_CPU_TYPE_HOST, - .arch = VIR_ARCH_X86_64, - .model = (char *) "host", - .vendor = (char *) "CPU Vendorrr", - }; - - domCaps->maxvcpus = 255; - os->supported = true; - - loader->supported = true; - SET_ALL_BITS(loader->type); - SET_ALL_BITS(loader->readonly); - if (fillStringValues(&loader->values, - "/foo/bar", - "/tmp/my_path", - NULL) < 0) - return -1; - - cpu->hostPassthrough = true; - cpu->hostModel = virCPUDefCopy(&host); - if (!(cpu->custom = virDomainCapsCPUModelsNew(3)) || - virDomainCapsCPUModelsAdd(cpu->custom, "Model1", -1, - VIR_DOMCAPS_CPU_USABLE_UNKNOWN, NULL) < 0 || - virDomainCapsCPUModelsAdd(cpu->custom, "Model2", -1, - VIR_DOMCAPS_CPU_USABLE_NO, NULL) < 0 || - virDomainCapsCPUModelsAdd(cpu->custom, "Model3", -1, - VIR_DOMCAPS_CPU_USABLE_YES, NULL) < 0) - return -1; - - disk->supported = true; - SET_ALL_BITS(disk->diskDevice); - SET_ALL_BITS(disk->bus); - SET_ALL_BITS(disk->model); - - graphics->supported = true; - SET_ALL_BITS(graphics->type); - - video->supported = true; - SET_ALL_BITS(video->modelType); - - hostdev->supported = true; - SET_ALL_BITS(hostdev->mode); - SET_ALL_BITS(hostdev->startupPolicy); - SET_ALL_BITS(hostdev->subsysType); - SET_ALL_BITS(hostdev->capsType); - SET_ALL_BITS(hostdev->pciBackend); - return 0; -} - - #if WITH_QEMU # include "testutilsqemu.h" # include "testutilshostcpus.h" @@ -258,7 +194,6 @@ fillBhyveCaps(virDomainCapsPtr domCaps, unsigned int *bhyve_caps) enum testCapsType { CAPS_NONE, - CAPS_ALL, CAPS_QEMU, CAPS_LIBXL, CAPS_BHYVE, @@ -297,11 +232,6 @@ test_virDomainCapsFormat(const void *opaque) case CAPS_NONE: break; - case CAPS_ALL: - if (fillAllCaps(domCaps) < 0) - goto cleanup; - break; - case CAPS_QEMU: #if WITH_QEMU if (fillQemuCaps(domCaps, data->capsName, data->arch, data->machine, @@ -407,9 +337,6 @@ mymain(void) ret = -1; \ } while (0) - DO_TEST("full", "/bin/emulatorbin", "my-machine-type", - "x86_64", VIR_DOMAIN_VIRT_KVM, CAPS_ALL); - #define DO_TEST_BHYVE(Name, Emulator, BhyveCaps, Type) \ do { \ char *name = NULL; \