From nobody Sat Nov 23 05:41:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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.133.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=1682065577; cv=none; d=zohomail.com; s=zohoarc; b=Ar+vyehdIPUtK+9lXhgmAp4JygOZId1C6GcddzvIxgl+LWIoSEZvqYcfU9erQhbXYY1qoG5+WfHgSOcKdS454lsTMNNKWZdIZSRO6c4KkIAsxrDgCSdu/Ke9HPUJoKw5/HJN4JnQVmy1m8NlFwpQJh0nnCxMRFUWed5+ERty5xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682065577; 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=YinFwsyj1vRCYv/LX2CflxLcLRSPflQj4UIPwM7JLdU=; b=A9vufSebzS9enJZyU3f9ivsVbcK2RE3u4v4lsb5ePIlDdrXy53KM7nCsjoXb7wl/Q3LXghcP/25O0d7l6mIzViTlsMiq8tjdE/CecQg7uggDCQ/wzfeXp2lR/qI0ajTavcplbGuuIkkST9I7mw2N8CmUg8rLFYcxyEzb7sDa7Vo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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.133.124]) by mx.zohomail.com with SMTPS id 16820655777101003.205461161657; Fri, 21 Apr 2023 01:26:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-115-GNYZQzWtOXCGDI1So1C5Zw-1; Fri, 21 Apr 2023 04:25:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 201F62999B4F; Fri, 21 Apr 2023 08:25:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA7DC2166B33; Fri, 21 Apr 2023 08:25:22 +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 AA2191946A40; Fri, 21 Apr 2023 08:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D72E619466DF for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id CA3545AB7A; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71D7663ABE for ; Fri, 21 Apr 2023 08:25:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682065576; 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=YinFwsyj1vRCYv/LX2CflxLcLRSPflQj4UIPwM7JLdU=; b=XKWJxCivX4NsLSNv2O9sbiR83Z0JpEXR6BmGUlv/GwmAIsSXCN+bJ0eEtQkgA2E98ybIll QfMCRxBJIs6X23VH/GXhZtXrFxOJ1zBdN6x0AHgA7ORziEB1Fds48xlg4Mvg2ftpLBrjfc XZ2wtmeRykI3k1kmkI8eS/LcQfBzL5g= X-MC-Unique: GNYZQzWtOXCGDI1So1C5Zw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 11/11] qemuhotplugtest: Verify domain XML on UPDATE Date: Fri, 21 Apr 2023 10:25:10 +0200 Message-Id: <4e6a5c8ef2e29b506bc5e79f971443b6cd8c8ef6.1682065352.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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.6 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: 1682065579220100004 Content-Type: text/plain; charset="utf-8"; x-default="true" Just like we check the resulting domain XML after ATTACH and DETACH, we should do the same after UPDATE action. This is as simple as calling testQemuHotplugCheckResult() and providing missing XMLs. For those test cases where no change is done, we can just make the expected XML a symlink to the input XML. Signed-off-by: Michal Privoznik --- tests/qemuhotplugtest.c | 9 +- ...hotplug-disk-cdrom+disk-cdrom-nochange.xml | 1 + .../qemuhotplug-disk-cdrom.xml | 30 ++++- ...graphics-spice+graphics-spice-nochange.xml | 1 + ...graphics-spice-listen-network-password.xml | 71 +++++++++++ ...imeout+graphics-spice-timeout-nochange.xml | 1 + ...imeout+graphics-spice-timeout-password.xml | 117 ++++++++++++++++++ .../qemuhotplug-graphics-spice-timeout.xml | 50 ++++++-- .../qemuhotplug-graphics-spice.xml | 41 ++++-- 9 files changed, 295 insertions(+), 26 deletions(-) create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+dis= k-cdrom-nochange.xml create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= +graphics-spice-nochange.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -listen-network+graphics-spice-listen-network-password.xml create mode 120000 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -timeout+graphics-spice-timeout-nochange.xml create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice= -timeout+graphics-spice-timeout-password.xml diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index fffb4a3410..091fcc4d49 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -123,7 +123,7 @@ testQemuHotplugCheckResult(virDomainObj *vm, if (!actual) return -1; =20 - if (STREQ(expected, actual)) { + if (STREQ_NULLABLE(expected, actual)) { if (fail) VIR_TEST_VERBOSE("domain XML should not match the expected res= ult"); ret =3D 0; @@ -170,7 +170,9 @@ testQemuHotplug(const void *data) virTestLoadFile(device_filename, &device_xml) < 0) goto cleanup; =20 - if (test->action =3D=3D ATTACH && + if (!fail && + (test->action =3D=3D ATTACH || + test->action =3D=3D UPDATE) && virTestLoadFile(result_filename, &result_xml) < 0) goto cleanup; =20 @@ -243,6 +245,9 @@ testQemuHotplug(const void *data) =20 case UPDATE: ret =3D qemuDomainUpdateDeviceLive(vm, dev, &driver, false); + if (ret =3D=3D 0 || fail) + ret =3D testQemuHotplugCheckResult(vm, result_xml, + result_filename, fail); } =20 virObjectLock(priv->mon); diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom= -nochange.xml b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cd= rom-nochange.xml new file mode 120000 index 0000000000..e07b01b301 --- /dev/null +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom+disk-cdrom-nochan= ge.xml @@ -0,0 +1 @@ +qemuhotplug-disk-cdrom.xml \ No newline at end of file diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml b/test= s/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml index 3acf55ab17..bcf4cf9bf8 100644 --- a/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml +++ b/tests/qemuhotplugtestdomains/qemuhotplug-disk-cdrom.xml @@ -1,4 +1,4 @@ - + QEMUGuest1 c7a5fdbd-edaf-9455-926a-d65c16db1809 219100 @@ -8,6 +8,9 @@ hvm + + qemu64 + destroy restart @@ -18,6 +21,7 @@ +
@@ -25,13 +29,27 @@ +
- - - - - + + +
+ + + +
+ + + + + + + + + + +