From nobody Fri Dec 19 20:40:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1548692375114596.0544217568928; Mon, 28 Jan 2019 08:19:35 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4258C3F72C; Mon, 28 Jan 2019 16:19:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B0DC269217; Mon, 28 Jan 2019 16:19:29 +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 0E7B03F600; Mon, 28 Jan 2019 16:19:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x0SGJGHj018062 for ; Mon, 28 Jan 2019 11:19:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0CE9917CCB; Mon, 28 Jan 2019 16:19:16 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 885D0614C2 for ; Mon, 28 Jan 2019 16:19:15 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 28 Jan 2019 17:18:41 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/32] tests: qemuxml2argv: Remove the 'after startup XML' testing machinery 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 28 Jan 2019 16:19:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" A lot of code with no real impact and popularity. Remove all the helpers now that the only test case is gone. Signed-off-by: Peter Krempa --- tests/Makefile.am | 1 - tests/qemuxml2argvtest.c | 54 +++------------------------------------- 2 files changed, 3 insertions(+), 52 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index f74d8463b6..3ee6a5cfae 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -129,7 +129,6 @@ EXTRA_DIST =3D \ qemumigparamsdata \ qemumonitorjsondata \ qemuxml2argvdata \ - qemuxml2startupxmloutdata \ qemuxml2xmloutdata \ qemustatusxml2xmldata \ qemumemlockdata \ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c2992dd524..d1d3cfaca4 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -291,9 +291,8 @@ typedef enum { FLAG_EXPECT_FAILURE =3D 1 << 0, FLAG_EXPECT_PARSE_ERROR =3D 1 << 1, FLAG_FIPS =3D 1 << 2, - FLAG_STEAL_VM =3D 1 << 3, - FLAG_REAL_CAPS =3D 1 << 4, - FLAG_SKIP_LEGACY_CPUS =3D 1 << 5, + FLAG_REAL_CAPS =3D 1 << 3, + FLAG_SKIP_LEGACY_CPUS =3D 1 << 4, } virQemuXML2ArgvTestFlags; struct testInfo { @@ -304,7 +303,6 @@ struct testInfo { int migrateFd; unsigned int flags; unsigned int parseFlags; - virDomainObjPtr vm; }; @@ -428,49 +426,16 @@ testUpdateQEMUCaps(const struct testInfo *info, } -static int -testCompareXMLToStartupXML(const void *data) -{ - const struct testInfo *info =3D data; - unsigned int format_flags =3D VIR_DOMAIN_DEF_FORMAT_SECURE; - char *xml =3D NULL; - char *actual =3D NULL; - int ret =3D -1; - - if (!info->vm) { - VIR_TEST_DEBUG("VM object missing. Did the args conversion succeed= ?"); - return -1; - } - - if (virAsprintf(&xml, "%s/qemuxml2startupxmloutdata/%s.xml", - abs_srcdir, info->name) < 0) - goto cleanup; - - if (!(actual =3D virDomainDefFormat(info->vm->def, NULL, format_flags)= )) - goto cleanup; - - ret =3D virTestCompareToFile(actual, xml); - - cleanup: - VIR_FREE(xml); - VIR_FREE(actual); - return ret; -} - - static int testCheckExclusiveFlags(int flags) { virCheckFlags(FLAG_EXPECT_FAILURE | FLAG_EXPECT_PARSE_ERROR | FLAG_FIPS | - FLAG_STEAL_VM | FLAG_REAL_CAPS | FLAG_SKIP_LEGACY_CPUS | 0, -1); - VIR_EXCLUSIVE_FLAGS_RET(FLAG_STEAL_VM, FLAG_EXPECT_FAILURE, -1); - VIR_EXCLUSIVE_FLAGS_RET(FLAG_STEAL_VM, FLAG_EXPECT_PARSE_ERROR, -1); VIR_EXCLUSIVE_FLAGS_RET(FLAG_REAL_CAPS, FLAG_SKIP_LEGACY_CPUS, -1); return 0; } @@ -643,9 +608,6 @@ testCompareXMLToArgv(const void *data) ret =3D 0; } - if (flags & FLAG_STEAL_VM) - VIR_STEAL_PTR(info->vm, vm); - cleanup: VIR_FREE(log); VIR_FREE(actualargv); @@ -781,7 +743,7 @@ mymain(void) do { \ static struct testInfo info =3D { \ name, "." suffix, NULL, migrateFrom, migrateFrom ? 7 : -1,\ - (flags | FLAG_REAL_CAPS), parseFlags, NULL \ + (flags | FLAG_REAL_CAPS), parseFlags, \ }; \ if (!(info.qemuCaps =3D qemuTestParseCapabilitiesArch(virArchFromS= tring(arch), \ capsfile))) \ @@ -792,7 +754,6 @@ mymain(void) testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ virObjectUnref(info.qemuCaps); \ - virObjectUnref(info.vm); \ } while (0) # define TEST_CAPS_PATH abs_srcdir "/qemucapabilitiesdata/caps_" @@ -838,7 +799,6 @@ mymain(void) do { \ static struct testInfo info =3D { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags,= \ - NULL \ }; \ if (testInitQEMUCaps(&info, gic) < 0) \ return EXIT_FAILURE; \ @@ -846,12 +806,7 @@ mymain(void) if (virTestRun("QEMU XML-2-ARGV " name, \ testCompareXMLToArgv, &info) < 0) \ ret =3D -1; \ - if (((flags) & FLAG_STEAL_VM) && \ - virTestRun("QEMU XML-2-startup-XML " name, \ - testCompareXMLToStartupXML, &info) < 0) \ - ret =3D -1; \ virObjectUnref(info.qemuCaps); \ - virObjectUnref(info.vm); \ } while (0) # define DO_TEST(name, ...) \ @@ -860,9 +815,6 @@ mymain(void) # define DO_TEST_GIC(name, gic, ...) \ DO_TEST_FULL(name, NULL, -1, 0, 0, gic, __VA_ARGS__) -# define DO_TEST_WITH_STARTUP(name, ...) \ - DO_TEST_FULL(name, NULL, -1, FLAG_STEAL_VM, 0, GIC_NONE, __VA_ARGS__) - # define DO_TEST_FAILURE(name, ...) \ DO_TEST_FULL(name, NULL, -1, FLAG_EXPECT_FAILURE, \ 0, GIC_NONE, __VA_ARGS__) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list