From patchwork Thu Jan 28 20:30:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 60762 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp711260lbb; Thu, 28 Jan 2016 12:44:35 -0800 (PST) X-Received: by 10.31.52.195 with SMTP id b186mr3321972vka.39.1454013874996; Thu, 28 Jan 2016 12:44:34 -0800 (PST) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id x13si10424023vkx.175.2016.01.28.12.44.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 12:44:34 -0800 (PST) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0SKgBqb062428; Thu, 28 Jan 2016 15:42:11 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.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 u0SKUMZG026840 for ; Thu, 28 Jan 2016 15:30:22 -0500 Received: from colepc.redhat.com (ovpn-113-198.phx2.redhat.com [10.3.113.198]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0SKUGKn010886; Thu, 28 Jan 2016 15:30:22 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 28 Jan 2016 15:30:11 -0500 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/9] tests: qemuxml2xml: Allow test cases to pass in qemuCaps 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: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com Similar to how we do it for qemuxml2argvtest. This will be used in future patches. --- tests/qemuxml2xmltest.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2400538..0134815 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -250,12 +250,13 @@ mymain(void) /* TODO: test with format probing disabled too */ driver.config->allowDiskFormatProbing = true; -# define DO_TEST_FULL(name, when) \ +# define DO_TEST_FULL(name, when, ...) \ do { \ if (testInfoSet(&info, name, when) < 0) { \ VIR_TEST_DEBUG("Failed to generate test data for '%s'", name); \ return -1; \ } \ + virQEMUCapsSetList(info.qemuCaps, __VA_ARGS__, QEMU_CAPS_LAST); \ \ if (info.outInactiveName) { \ if (virtTestRun("QEMU XML-2-XML-inactive " name, \ @@ -275,8 +276,12 @@ mymain(void) testInfoFree(&info); \ } while (0) +# define NONE QEMU_CAPS_LAST + # define DO_TEST(name) \ - DO_TEST_FULL(name, WHEN_BOTH) + DO_TEST_FULL(name, WHEN_BOTH, NONE) + + /* Unset or set all envvars here that are copied in qemudBuildCommandLine * using ADD_ENV_COPY, otherwise these tests may fail due to unexpected @@ -381,9 +386,9 @@ mymain(void) DO_TEST("disk-virtio-scsi-ioeventfd"); DO_TEST("disk-scsi-megasas"); DO_TEST("disk-mirror-old"); - DO_TEST_FULL("disk-mirror", WHEN_ACTIVE); - DO_TEST_FULL("disk-mirror", WHEN_INACTIVE); - DO_TEST_FULL("disk-active-commit", WHEN_ACTIVE); + DO_TEST_FULL("disk-mirror", WHEN_ACTIVE, NONE); + DO_TEST_FULL("disk-mirror", WHEN_INACTIVE, NONE); + DO_TEST_FULL("disk-active-commit", WHEN_ACTIVE, NONE); DO_TEST("graphics-listen-network"); DO_TEST("graphics-vnc"); DO_TEST("graphics-vnc-websocket"); @@ -478,17 +483,17 @@ mymain(void) DO_TEST("blkdeviotune"); DO_TEST("controller-usb-order"); - DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE); - DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE); - DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE); - DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE); + DO_TEST_FULL("seclabel-dynamic-baselabel", WHEN_INACTIVE, NONE); + DO_TEST_FULL("seclabel-dynamic-override", WHEN_INACTIVE, NONE); + DO_TEST_FULL("seclabel-dynamic-labelskip", WHEN_INACTIVE, NONE); + DO_TEST_FULL("seclabel-dynamic-relabel", WHEN_INACTIVE, NONE); DO_TEST("seclabel-static"); - DO_TEST_FULL("seclabel-static-labelskip", WHEN_ACTIVE); + DO_TEST_FULL("seclabel-static-labelskip", WHEN_ACTIVE, NONE); DO_TEST("seclabel-none"); DO_TEST("seclabel-dac-none"); DO_TEST("seclabel-dynamic-none"); DO_TEST("seclabel-device-multiple"); - DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE); + DO_TEST_FULL("seclabel-dynamic-none-relabel", WHEN_INACTIVE, NONE); DO_TEST("numad-static-vcpu-no-numatune"); DO_TEST("disk-scsi-lun-passthrough-sgio");