[Pkg-libvirt-commits] [Git][libvirt-team/virt-manager][debian/sid] d/patches: add fixes from upstream for FTBFS with libvirt 8.5
Guido Günther (@agx)
gitlab at salsa.debian.org
Thu Aug 4 12:47:08 BST 2022
Guido Günther pushed to branch debian/sid at Libvirt Packaging Team / virt-manager
Commits:
d246d203 by Fabio Fantoni at 2022-08-04T13:17:54+02:00
d/patches: add fixes from upstream for FTBFS with libvirt 8.5
- tests: Fix with latest osinfo-db
- tests: Fix with latest argcomplete
- tests: Fix with latest libvirt
Closes: #1013667
- - - - -
4 changed files:
- debian/patches/series
- + debian/patches/upstream_tests-fix-with-latest-argcomplete.patch
- + debian/patches/upstream_tests-fix-with-latest-libvirt.patch
- + debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch
Changes:
=====================================
debian/patches/series
=====================================
@@ -1,2 +1,5 @@
upstream_tests-drop-usage-of-sgio-unfiltered.patch
upstream_tests-fix-another-sgio-filtered-case.patch
+upstream_tests-fix-with-latest-osinfo-db.patch
+upstream_tests-fix-with-latest-argcomplete.patch
+upstream_tests-fix-with-latest-libvirt.patch
=====================================
debian/patches/upstream_tests-fix-with-latest-argcomplete.patch
=====================================
@@ -0,0 +1,40 @@
+From 34662fecc9535c7d8d0a8e7d42fafa4b9e005c89 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso at redhat.com>
+Date: Mon, 13 Jun 2022 12:55:31 -0400
+Subject: [PATCH] tests: Fix with latest argcomplete
+
+Signed-off-by: Cole Robinson <crobinso at redhat.com>
+---
+ virtinst/cli.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/virtinst/cli.py b/virtinst/cli.py
+index 52be9f298..c42fc0f0a 100644
+--- a/virtinst/cli.py
++++ b/virtinst/cli.py
+@@ -552,7 +552,15 @@ def autocomplete(parser):
+ kwargs = {"validator": _completer_validator}
+ if xmlutil.in_testsuite():
+ import io
+- kwargs["output_stream"] = io.BytesIO()
++ class MyStream(io.StringIO):
++ # Custom class to handle both bytes() and str() on write.
++ # With argcomplete 2.0.0 and/or python3.10 something changed
++ # here, so this should hopefully cover back compat
++ def write(self, msg, *args, **kwargs):
++ if type(msg) is bytes:
++ msg = msg.decode("utf-8") # pragma: no cover
++ return super().write(msg, *args, **kwargs)
++ kwargs["output_stream"] = MyStream()
+ kwargs["exit_method"] = sys.exit
+
+ # This fdopen hackery is to avoid argcomplete debug_stream behavior
+@@ -568,7 +576,7 @@ def fake_fdopen_cb(*args, **kwargs):
+ argcomplete.autocomplete(parser, **kwargs)
+ except SystemExit:
+ if xmlutil.in_testsuite():
+- output = kwargs["output_stream"].getvalue().decode("utf-8")
++ output = kwargs["output_stream"].getvalue()
+ print(output)
+ raise
+
=====================================
debian/patches/upstream_tests-fix-with-latest-libvirt.patch
=====================================
@@ -0,0 +1,90 @@
+From a4a5c1529a81c5bd5636b4847b03643d97fa3dd3 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso at redhat.com>
+Date: Wed, 27 Jul 2022 17:51:21 -0400
+Subject: [PATCH] tests: Fix with latest libvirt
+
+Signed-off-by: Cole Robinson <crobinso at redhat.com>
+---
+ tests/data/cli/compare/virt-install-many-devices.xml | 1 -
+ .../cli/compare/virt-install-singleton-config-2.xml | 2 ++
+ tests/data/cli/compare/virt-xml-edit-boot-uefi.xml | 12 ++++++------
+ tests/test_cli.py | 6 ++++--
+ 4 files changed, 12 insertions(+), 9 deletions(-)
+
+--- a/tests/data/cli/compare/virt-install-many-devices.xml
++++ b/tests/data/cli/compare/virt-install-many-devices.xml
+@@ -105,7 +105,6 @@
+ <feature enabled="yes" name="secure-boot"/>
+ <feature enabled="no" name="enrolled-keys"/>
+ </firmware>
+- <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+ <initarg>foo=bar</initarg>
+ <initarg>baz=woo</initarg>
+ <initenv name="MYENV">some value</initenv>
+--- a/tests/data/cli/compare/virt-install-singleton-config-2.xml
++++ b/tests/data/cli/compare/virt-install-singleton-config-2.xml
+@@ -11,6 +11,7 @@
+ <vcpu cpuset="1,3-5">2</vcpu>
+ <os>
+ <type arch="x86_64" machine="q35">hvm</type>
++ <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+ <smbios mode="emulate"/>
+ <boot dev="network"/>
+ <boot dev="hd"/>
+@@ -111,6 +112,7 @@
+ <vcpu cpuset="1,3-5">2</vcpu>
+ <os>
+ <type arch="x86_64" machine="q35">hvm</type>
++ <loader readonly="yes" secure="no" type="rom">/tmp/foo</loader>
+ <boot dev="hd"/>
+ <smbios mode="emulate"/>
+ </os>
+--- a/tests/data/cli/compare/virt-xml-edit-boot-uefi.xml
++++ b/tests/data/cli/compare/virt-xml-edit-boot-uefi.xml
+@@ -1,11 +1,11 @@
+- <entry name="location">Upside down</entry>
+- </baseBoard>
+- </sysinfo>
++ <memory unit="KiB">8388608</memory>
++ <currentMemory unit="KiB">2097152</currentMemory>
++ <vcpu placement="static">2</vcpu>
+ - <os>
+ + <os firmware="efi">
+ <type arch="i686">hvm</type>
+- <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.fd</loader>
+- <nvram>/nvram/test-many-devices_VARS.fd</nvram>
++ <boot dev="hd"/>
++ </os>
+
+-Domain 'test-many-devices' defined successfully.
++Domain 'test' defined successfully.
+ Changes will take effect after the domain is fully powered off.
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -486,7 +486,6 @@
+ initargs="foo=bar baz=woo",initdir=/my/custom/cwd,inituser=tester,initgroup=1000,\
+ bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,\
+ bootmenu.enable=yes,bootmenu.timeout=5000,\
+-loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no,\
+ acpi.table=/path/to/slic.dat,acpi.table.type=slic,\
+ initenv0.name=MYENV,initenv0='some value',initenv1.name=FOO,initenv1=bar,\
+ initdir=/my/custom/cwd,inituser=tester,initgroup=1000
+@@ -830,6 +829,9 @@
+ "--seclabel type=dynamic " # test a fallback case when guessing model=
+ "--sysinfo emulate " # special `--sysinfo emulate` handling
+ "--cpuset 1,3-5 " # setting compat --cpuset when --vcpus is not present
++# --boot loader settings here, or they will conflict with firmware=efi
++# in other test cases
++"--boot loader_ro=yes,loader.type=rom,loader=/tmp/foo,loader_secure=no "
+
+ # 'default' handling for solo devices
+ """
+@@ -1341,7 +1343,7 @@
+ c.add_compare("--confirm 1 --edit --cpu host-passthrough", "prompt-response", input_text="yes") # prompt response, also using domid lookup
+ c.add_compare("--edit --print-diff --qemu-commandline clearxml=yes", "edit-clearxml-qemu-commandline", input_file=(_VIRTXMLDIR + "virtxml-qemu-commandline-clear.xml"))
+ c.add_compare("--print-diff --remove-device --serial 1", "remove-console-dup", input_file=(_VIRTXMLDIR + "virtxml-console-dup.xml"))
+-c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --boot uefi", "edit-boot-uefi")
++c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test --edit --boot uefi", "edit-boot-uefi")
+ c.add_compare("--print-diff --define --connect %(URI-KVM-X86)s test-many-devices --edit --cpu host-copy", "edit-cpu-host-copy")
+ c.add_compare("--connect %(URI-KVM-X86)s test-many-devices --build-xml --disk source.pool=pool-disk,source.volume=sdfg1", "build-pool-logical-disk")
+ c.add_compare("test --add-device --network default --update --confirm", "update-succeed", env={"VIRTXML_TESTSUITE_UPDATE_IGNORE_FAIL": "1", "VIRTINST_TEST_SUITE_INCREMENT_MACADDR": "1"}, input_text="yes\nyes\n") # test hotplug success
=====================================
debian/patches/upstream_tests-fix-with-latest-osinfo-db.patch
=====================================
@@ -0,0 +1,61 @@
+From 0533bb8189c2d36fc18121bf394be5d35c038066 Mon Sep 17 00:00:00 2001
+From: Cole Robinson <crobinso at redhat.com>
+Date: Mon, 13 Jun 2022 12:59:44 -0400
+Subject: [PATCH] tests: Fix with latest osinfo-db
+
+linux2020 is now reporting virtio-gpu support, adjust output and
+add a compat check
+
+Signed-off-by: Cole Robinson <crobinso at redhat.com>
+---
+ tests/data/cli/compare/virt-install-linux2020.xml | 4 ++--
+ tests/test_cli.py | 7 ++++++-
+ 2 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/tests/data/cli/compare/virt-install-linux2020.xml b/tests/data/cli/compare/virt-install-linux2020.xml
+index cd3e8bb4d..5a7d7adf3 100644
+--- a/tests/data/cli/compare/virt-install-linux2020.xml
++++ b/tests/data/cli/compare/virt-install-linux2020.xml
+@@ -71,7 +71,7 @@
+ </graphics>
+ <sound model="ich9"/>
+ <video>
+- <model type="qxl"/>
++ <model type="virtio"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+@@ -154,7 +154,7 @@
+ </graphics>
+ <sound model="ich9"/>
+ <video>
+- <model type="qxl"/>
++ <model type="virtio"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+diff --git a/tests/test_cli.py b/tests/test_cli.py
+index 6a0df7870..02843b102 100644
+--- a/tests/test_cli.py
++++ b/tests/test_cli.py
+@@ -117,6 +117,11 @@ def no_osinfo_unattended_win_drivers_cb():
+ return "osinfo is too old for this win7 unattended test"
+
+
++def no_osinfo_linux2020_virtio():
++ linux2020 = OSDB.lookup_os("linux2020")
++ return not linux2020 or not linux2020.supports_virtiogpu()
++
++
+ ######################
+ # Test class helpers #
+ ######################
+@@ -1080,7 +1085,7 @@ def add_compare(self, cat, args, compbase, **kwargs):
+ c.add_compare("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --sound --controller usb", "kvm-win2k3-cdrom") # HVM windows install with disk
+ c.add_compare("--os-variant name=ubuntusaucy --nodisks --boot cdrom --virt-type qemu --cpu Penryn --input tablet --boot uefi --graphics vnc", "qemu-plain") # plain qemu
+ c.add_compare("--os-variant fedora20 --nodisks --boot network --graphics default --arch i686 --rng none", "qemu-32-on-64", prerun_check=has_old_osinfo) # 32 on 64
+-c.add_compare("--osinfo linux2020 --pxe", "linux2020", prerun_check=lambda: not OSDB.lookup_os("linux2020"))
++c.add_compare("--osinfo linux2020 --pxe", "linux2020", prerun_check=no_osinfo_linux2020_virtio)
+ c.add_compare("--osinfo generic --disk none --location %(ISO-NO-OS)s,kernel=frib.img,initrd=/frob.img", "location-manual-kernel", prerun_check=missing_xorriso) # --location with an unknown ISO but manually specified kernel paths
+ c.add_compare("--disk %(EXISTIMG1)s --location %(ISOTREE)s --nonetworks", "location-iso", prerun_check=missing_xorriso) # Using --location iso mounting
+ c.add_compare("--disk %(EXISTIMG1)s --cdrom %(ISOLABEL)s", "cdrom-centos-label") # Using --cdrom with centos CD label, should use virtio etc.
View it on GitLab: https://salsa.debian.org/libvirt-team/virt-manager/-/commit/d246d203204c598341925384a64a9adfecbb2227
--
View it on GitLab: https://salsa.debian.org/libvirt-team/virt-manager/-/commit/d246d203204c598341925384a64a9adfecbb2227
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-libvirt-commits/attachments/20220804/09decb1d/attachment-0001.htm>
More information about the Pkg-libvirt-commits
mailing list