From nobody Wed Nov 27 08:51:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=szczek.dev ARC-Seal: i=1; a=rsa-sha256; t=1724057008; cv=none; d=zohomail.com; s=zohoarc; b=ZZXBPuSrAa/iiaQQrbxABdA8TgT3FK1exdhrsxEv9feb9GScjpCotMSQ/8zSFptJX57X5NUXn1NYDNXdQ4RKKHQfMvuHEOvVl5VFAFwSj2AC1RW0Hwy4I9rugpiyFK35Urw5QFNBVg+I8/u0ijadK+KAyLn/raYy5Kfq6eFfGI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724057008; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=HnfLejkdtYBcy+ODUka1EO4TVWupXQ2kqO49Sj5cuF4=; b=JzoRsF0q+nvpbr5624bsnwDTnk5UGeVNlePH+c/HJwj8Fe5pyDD+0p0p9rySKdVh0fc2/fPAELkZBdXUrU0L76md2hmExgEU7Mni+2dFedx2lTnDXdN77Vc+ILmlI0kzs2/TzOtkZlsl19ODU8EEAOX6EHdMvfBrNg4zTv0YdHc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 172405700801535.23749428083909; Mon, 19 Aug 2024 01:43:28 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EB70315B7; Mon, 19 Aug 2024 04:43:26 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 5E7041619; Mon, 19 Aug 2024 04:38:32 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DC7A413A0; Sun, 18 Aug 2024 21:20:03 -0400 (EDT) Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id CBF9F1400 for ; Sun, 18 Aug 2024 21:20:02 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szczek.dev; s=protonmail; t=1724030400; x=1724289600; bh=HnfLejkdtYBcy+ODUka1EO4TVWupXQ2kqO49Sj5cuF4=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=A21aMxvFnq6uAK74y1xhdvjVVMqwYXIKhXGjCUmGLljd6ROyO+s118mlYC8mlbF/X InFcdEqH0K4ZJzyz6ru6PSCG5mS9pOXeAdKJVh/t0Yc7lpfA+yTt39UKwpvImXozhy b3e3W7D/QQhgOwqgoON6frLBSXiMy71GTZyIW1j13wAz1Vx47EZDBQJ33FpauRuWq4 yMhqhncs4iUUixdsOzPkiDXATFF9svJxduV4ULDblV8NwF2vqRQHYAJnxq2toJdsqM PzZ2uE1XsXyq7MYSqOKzySpLgPx9WLKpdCwPo4JeeRmKPHu7rrIKDKWpbEQnMs4zNZ FUWrdQDr2+l5w== Date: Mon, 19 Aug 2024 01:19:55 +0000 To: "devel@lists.libvirt.org" From: =?utf-8?Q?Kamil_Szcz=C4=99k?= Subject: [PATCH v3 5/6] qemuxmlconftest: Add test cases for the new 'ps2' feature Message-ID: In-Reply-To: References: Feedback-ID: 37679334:user:proton X-Pm-Message-ID: 201ee8bd633f726eeff4814e476c6012e5bd5e0f MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MailFrom: kamil@szczek.dev X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 Message-ID-Hash: WU3N3OCBWMELQUWIDL5LHFY5KKZ65KNQ X-Message-ID-Hash: WU3N3OCBWMELQUWIDL5LHFY5KKZ65KNQ X-Mailman-Approved-At: Mon, 19 Aug 2024 08:38:18 -0400 X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @szczek.dev) X-ZM-MESSAGEID: 1724057008845116600 Content-Type: text/plain; charset="utf-8" Introduce tests to verify that the 'ps2' feature is correctly parsed when given either 'dirty' XML from a user or 'clean' canonical XML, as produced by libvirt. This also tests the transformation from libvirt's internal state to the aforementioned canonical form and to a QEMU command line. As a bonus, we also test some known bad configurations: - When user explicitly adds ps2 bus inputs, but also explicitly disables the 'ps2' feature. - When user explicitly enables the 'vmport' feature, but also explicitly disables the 'ps2' feature. This is not supported by QEMU and will result in vmport device not being created without emitting any warning or error. Signed-off-by: Kamil Szcz=C4=99k --- ...-off-explicit-ps2-inputs.x86_64-latest.err | 1 + .../machine-i8042-off-explicit-ps2-inputs.xml | 19 +++++++++++ ...hine-i8042-off-vmport-on.x86_64-latest.err | 1 + .../machine-i8042-off-vmport-on.xml | 18 ++++++++++ .../machine-i8042-off.x86_64-6.2.0.err | 1 + .../machine-i8042-off.x86_64-latest.args | 33 ++++++++++++++++++ .../machine-i8042-off.x86_64-latest.xml | 32 +++++++++++++++++ tests/qemuxmlconfdata/machine-i8042-off.xml | 17 ++++++++++ .../machine-i8042-on.x86_64-6.2.0.err | 1 + .../machine-i8042-on.x86_64-latest.args | 33 ++++++++++++++++++ .../machine-i8042-on.x86_64-latest.xml | 34 +++++++++++++++++++ tests/qemuxmlconfdata/machine-i8042-on.xml | 17 ++++++++++ tests/qemuxmlconftest.c | 6 ++++ 13 files changed, 213 insertions(+) create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-in= puts.x86_64-latest.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-in= puts.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_6= 4-latest.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.a= rgs create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.x= ml create mode 100644 tests/qemuxmlconfdata/machine-i8042-off.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-6.2.0.err create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.ar= gs create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/machine-i8042-on.xml diff --git a/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x8= 6_64-latest.err b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inpu= ts.x86_64-latest.err new file mode 100644 index 0000000000..4fed60aa37 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.x86_64-la= test.err @@ -0,0 +1 @@ +unsupported configuration: ps2 bus inputs require the ps2 feature not to b= e disabled diff --git a/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xm= l b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml new file mode 100644 index 0000000000..f90677670b --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-explicit-ps2-inputs.xml @@ -0,0 +1,19 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + /usr/bin/qemu-system-x86_64 + + + + + + diff --git a/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-lates= t.err b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err new file mode 100644 index 0000000000..0c3b7280c0 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.x86_64-latest.err @@ -0,0 +1 @@ +unsupported configuration: vmport feature requires the ps2 feature not to = be disabled diff --git a/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml b/tests/= qemuxmlconfdata/machine-i8042-off-vmport-on.xml new file mode 100644 index 0000000000..957da054b8 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off-vmport-on.xml @@ -0,0 +1,18 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 1 + + hvm + + + + + + + /usr/bin/qemu-system-x86_64 + + + + diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err b/tes= ts/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err new file mode 100644 index 0000000000..3a12712915 --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-6.2.0.err @@ -0,0 +1 @@ +unsupported configuration: ps2 feature state cannot be controlled with thi= s QEMU binary diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args b/t= ests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args new file mode 100644 index 0000000000..e340d164fc --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.args @@ -0,0 +1,33 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine q35,usb=3Doff,i8042=3Doff,dump-guest-core=3Doff,memory-backend=3D= pc.ram,acpi=3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-global ICH9-LPC.noreboot=3Doff \ +-watchdog-action reset \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml b/te= sts/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml new file mode 100644 index 0000000000..b5c503e6df --- /dev/null +++ b/tests/qemuxmlconfdata/machine-i8042-off.x86_64-latest.xml @@ -0,0 +1,32 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + hvm + + + + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + +
+ + +