From patchwork Tue Feb 16 17:44:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 62068 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1807509lbl; Tue, 16 Feb 2016 09:47:31 -0800 (PST) X-Received: by 10.140.19.43 with SMTP id 40mr29136320qgg.72.1455644851774; Tue, 16 Feb 2016 09:47:31 -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 z17si41619544qka.125.2016.02.16.09.47.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Feb 2016 09:47:31 -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 u1GHiaAN061445; Tue, 16 Feb 2016 12:44:37 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u1GHiZqm015503 for ; Tue, 16 Feb 2016 12:44:35 -0500 Received: from colepc.redhat.com (ovpn-113-23.phx2.redhat.com [10.3.113.23]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1GHiX43011999; Tue, 16 Feb 2016 12:44:35 -0500 From: Cole Robinson To: libvirt-list@redhat.com Date: Tue, 16 Feb 2016 12:44:29 -0500 Message-Id: <891b0ded6dde1fc31db46632f7ead73d6a2feb2d.1455644471.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/5] tests: qemuargv2xml: Remove UUID randomness 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 Overwrite any randomly generated UUID to use a hardcoded value, so we don't need to blank it when comparing XML. --- .../qemuargv2xml-hostdev-pci-address.xml | 2 +- .../qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml | 2 +- .../qemuargv2xml-misc-disable-suspends.xml | 2 +- .../qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml | 2 +- tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml | 2 +- tests/qemuargv2xmltest.c | 19 +++++++++++++++++-- 7 files changed, 23 insertions(+), 8 deletions(-) -- 2.5.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuargv2xmldata/qemuargv2xml-hostdev-pci-address.xml b/tests/qemuargv2xmldata/qemuargv2xml-hostdev-pci-address.xml index 77b484d..937238a 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-hostdev-pci-address.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-hostdev-pci-address.xml @@ -1,6 +1,6 @@ QEMUGuest2 - c7a5fdbd-edaf-9466-926a-d65c16db1809 + c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 219100 1 diff --git a/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml b/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml index 3619c24..1545064 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-s3.xml @@ -1,6 +1,6 @@ QEMUGuest1 - 8caaa98c-e7bf-5845-126a-1fc316bd1089 + c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 219100 1 diff --git a/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-suspends.xml b/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-suspends.xml index 30276e0..f6ebba9 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-suspends.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-misc-disable-suspends.xml @@ -1,6 +1,6 @@ QEMUGuest1 - 8caaa98c-e7bf-5845-126a-1fc316bd1089 + c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 219100 1 diff --git a/tests/qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml b/tests/qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml index ac8b3f0..089622c 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-misc-enable-s4.xml @@ -1,6 +1,6 @@ QEMUGuest1 - 8caaa98c-e7bf-5845-126a-1fc316bd1089 + c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 219100 1 diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml b/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml index 39f4a1f..44c3b1d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-disk.xml @@ -1,6 +1,6 @@ QEMUGuest1 - 87eedafe-eedc-4336-8130-ed9fe5dc90c8 + c7a5fdbd-edaf-9455-926a-d65c16db1809 524288 524288 1 diff --git a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml b/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml index 2da2832..eafe49d 100644 --- a/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml +++ b/tests/qemuargv2xmldata/qemuargv2xml-pseries-nvram.xml @@ -1,6 +1,6 @@ QEMUGuest1 - 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 + c7a5fdbd-edaf-9455-926a-d65c16db1809 524288 524288 1 diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c index f07818a..6650cf0 100644 --- a/tests/qemuargv2xmltest.c +++ b/tests/qemuargv2xmltest.c @@ -23,8 +23,7 @@ static virQEMUDriver driver; static int blankProblemElements(char *data) { - if (virtTestClearLineRegex("([[:alnum:]]|-)+", data) < 0 || - virtTestClearLineRegex("[[:digit:]]+", data) < 0 || + if (virtTestClearLineRegex("[[:digit:]]+", data) < 0 || virtTestClearLineRegex("", data) < 0 || virtTestClearLineRegex("[[:digit:]]+", data) < 0) @@ -32,6 +31,19 @@ static int blankProblemElements(char *data) return 0; } +static int testSanitizeDef(virDomainDefPtr vmdef) +{ + int ret = -1; + + /* Remove UUID randomness */ + if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", vmdef->uuid) < 0) + goto fail; + + ret = 0; + fail: + return ret; +} + typedef enum { FLAG_EXPECT_WARNING = 1 << 0, } virQemuXML2ArgvTestFlags; @@ -79,6 +91,9 @@ static int testCompareXMLToArgvFiles(const char *xml, } } + if (testSanitizeDef(vmdef) < 0) + goto fail; + if (!virDomainDefCheckABIStability(vmdef, vmdef)) { VIR_TEST_DEBUG("ABI stability check failed on %s", xml); goto fail;