From nobody Mon Feb 9 04:56:42 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1692889381; cv=none; d=zohomail.com; s=zohoarc; b=XifKn4la8AGEmmpKyTLtYZKEvXJIvDpIdHhr2aO4WciqB5YT6dp1lWVRYQi9yEVqlAGswKIlj31HiESa8l3XYnLboiR/wM5O1P9mLFqJMt4sCmKrjAMn9XamCuC0RLr7zFCqTFW64o1Qcdi2B7bpV6p3Fzw9oZOKTxRPvKB/PeU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692889381; 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=WAyAv6d8onYvY1hW8F2JCMV+s1a1zH+7o7IaPkaYf1Q=; b=F7UGld+w/2SYMQzK78WlK6A0E1L7n4rPXX9/Egz1APXBVFwzGUDQVpzXNAy+qnwjJ+1syB76ZxmrRcLzSMqvUZQ5IHVI4Qj8U00KrLyAh2LdiqFRhRzYVv3mgkXR4daDZUPunTv/2I+ZZKkiGPvNaJ+VqvD01sAHkmhkSgtsgoE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 169288938124938.27068763327634; Thu, 24 Aug 2023 08:03:01 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-627-UX5v8iVSM5mMj31icOf2Ww-1; Thu, 24 Aug 2023 11:02:56 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27783185A794; Thu, 24 Aug 2023 15:02:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AFC340282C; Thu, 24 Aug 2023 15:02:51 +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 4396F19465B1; Thu, 24 Aug 2023 15:02:45 +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 4E73919465A2 for ; Thu, 24 Aug 2023 15:02:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3D9DF2166B26; Thu, 24 Aug 2023 15:02:44 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB5092166B27 for ; Thu, 24 Aug 2023 15:02:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692889379; 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=WAyAv6d8onYvY1hW8F2JCMV+s1a1zH+7o7IaPkaYf1Q=; b=doHdLaqQM4L96XkSYkGkNb3jHOkuW6jOe7rNPOKzlXS48kmVwV3z+qY6TwG37xcPiQgXDI g2rWulw1dED/3GT/4YmHtqxS6hmI8zCL0HFRWjNVdncKGSOq94BhH2TZbu6U2fRf8F88Au jsmwVp8GrxUPZSOPu5Pb/3l7X6Es2A0= X-MC-Unique: UX5v8iVSM5mMj31icOf2Ww-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/5] qemuxml2argvtest: Pass expected state via struct testQemuInfo's 'flags' member Date: Thu, 24 Aug 2023 17:02:38 +0200 Message-ID: <6479b83bd641112431b41b1e566bb9a5461603ad.1692889197.git.pkrempa@redhat.com> 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.10 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: 1692889435459100001 Content-Type: text/plain; charset="utf-8" Rather than having a separate argument to DO_TEST pass the state via newly added flags 'FLAG_SKIP_CONFIG_ACTIVE'. The '_INACTIVE' equivalent was not added as there's no test which'd use it. Remove the old 'WHEN_' flags and move the decision logic out of the DO_TEST macro as any addition to the logic makes the compiler take much longer to compile qemuxml2xmltest. Signed-off-by: Peter Krempa --- tests/qemuxml2xmltest.c | 36 ++++++++++++++---------------------- tests/testutilsqemu.h | 1 + 2 files changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index c67909404f..e6018f8240 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -19,13 +19,6 @@ static virQEMUDriver driver; -enum { - WHEN_INACTIVE =3D 1, - WHEN_ACTIVE =3D 2, - WHEN_BOTH =3D 3, -}; - - static int testXML2XMLCommon(const struct testQemuInfo *info) { @@ -46,6 +39,9 @@ testXML2XMLActive(const void *opaque) { const struct testQemuInfo *info =3D opaque; + if (info->flags & FLAG_SKIP_CONFIG_ACTIVE) + return EXIT_AM_SKIP; + if (testXML2XMLCommon(info) < 0 || testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->infile, info->outfile, true, @@ -150,27 +146,23 @@ mymain(void) virSetConnectSecret(conn); virSetConnectStorage(conn); -#define DO_TEST_FULL(_name, suffix, when, ...) \ +#define DO_TEST_FULL(_name, suffix, ...) \ do { \ static struct testQemuInfo info =3D { \ .name =3D _name, \ }; \ testQemuInfoSetArgs(&info, &testConf, __VA_ARGS__); \ \ - if (when & WHEN_INACTIVE) { \ - testInfoSetPaths(&info, suffix, "inactive"); \ - virTestRunLog(&ret, "QEMU XML-2-XML-inactive " _name, testXML2= XMLInactive, &info); \ - } \ + testInfoSetPaths(&info, suffix, "inactive"); \ + virTestRunLog(&ret, "QEMU XML-2-XML-inactive " _name, testXML2XMLI= nactive, &info); \ \ - if (when & WHEN_ACTIVE) { \ - testInfoSetPaths(&info, suffix, "active"); \ - virTestRunLog(&ret, "QEMU XML-2-XML-active " _name, testXML2XM= LActive, &info); \ - } \ + testInfoSetPaths(&info, suffix, "active"); \ + virTestRunLog(&ret, "QEMU XML-2-XML-active " _name, testXML2XMLAct= ive, &info); \ testQemuInfoClear(&info); \ } while (0) #define DO_TEST_CAPS_INTERNAL(name, arch, ver, ...) \ - DO_TEST_FULL(name, "." arch "-" ver, WHEN_BOTH, \ + DO_TEST_FULL(name, "." arch "-" ver, \ ARG_CAPS_ARCH, arch, \ ARG_CAPS_VER, ver, \ __VA_ARGS__, \ @@ -511,17 +503,17 @@ mymain(void) DO_TEST_CAPS_ARCH_LATEST("ppc64-tpmproxy-single", "ppc64"); DO_TEST_CAPS_ARCH_LATEST("ppc64-tpmproxy-with-tpm", "ppc64"); - DO_TEST_FULL("seclabel-dynamic-baselabel", "", WHEN_INACTIVE, ARG_END); - DO_TEST_FULL("seclabel-dynamic-override", "", WHEN_INACTIVE, ARG_END); - DO_TEST_FULL("seclabel-dynamic-labelskip", "", WHEN_INACTIVE, ARG_END); - DO_TEST_FULL("seclabel-dynamic-relabel", "", WHEN_INACTIVE, ARG_END); + DO_TEST_FULL("seclabel-dynamic-baselabel", "", ARG_FLAGS, FLAG_SKIP_CO= NFIG_ACTIVE, ARG_END); + DO_TEST_FULL("seclabel-dynamic-override", "", ARG_FLAGS, FLAG_SKIP_CON= FIG_ACTIVE, ARG_END); + DO_TEST_FULL("seclabel-dynamic-labelskip", "", ARG_FLAGS, FLAG_SKIP_CO= NFIG_ACTIVE, ARG_END); + DO_TEST_FULL("seclabel-dynamic-relabel", "", ARG_FLAGS, FLAG_SKIP_CONF= IG_ACTIVE, ARG_END); DO_TEST_CAPS_LATEST("seclabel-static"); DO_TEST_CAPS_LATEST("seclabel-static-labelskip"); DO_TEST_CAPS_LATEST("seclabel-none"); DO_TEST_CAPS_LATEST("seclabel-dac-none"); DO_TEST_CAPS_LATEST("seclabel-dynamic-none"); DO_TEST_CAPS_LATEST("seclabel-device-multiple"); - DO_TEST_FULL("seclabel-dynamic-none-relabel", "", WHEN_INACTIVE, + DO_TEST_FULL("seclabel-dynamic-none-relabel", "", ARG_FLAGS, FLAG_SKIP= _CONFIG_ACTIVE, ARG_QEMU_CAPS, QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_SPICE, QEMU_CAPS_LAST, ARG_END); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index e0d116336e..7845ac7cb6 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -59,6 +59,7 @@ typedef enum { FLAG_REAL_CAPS =3D 1 << 3, FLAG_SKIP_LEGACY_CPUS =3D 1 << 4, FLAG_SLIRP_HELPER =3D 1 << 5, + FLAG_SKIP_CONFIG_ACTIVE =3D 1 << 6, /* Skip 'active' config test in qe= muxml2xmltest */ } testQemuInfoFlags; struct testQemuConf { --=20 2.41.0