Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 0/7] Mostly fix "make check-slow"
$ make && make check-slow I hadn't run this set of tests in a while and they were all failing. Luckily that was easy to fix (see patches 1 and 2). However we need to change the mix of guests being tested, dropping some old ones which are no longer testable, and adding some newer ones. There is one slow test which still fails (test-v2v-trim.sh) which I'm still looking at. Rich.
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 1/7] output: -o libvirt: Fix <graphics/> element port/autoport
According to https://libvirt.org/formatdomain.html only vnc and sdl graphics types support port/autoport. In addition, autoport='yes' is the non-deprecated replacement for port='-1'. Since we don't need to support ancient libvirt, we don't need to keep adding port='-1' in the autoport case. virt-xml-validate rejects our XML if it has both attributes. --- output/create_libvirt_xml.ml | 22 ++++++++++------------ tests/test-v2v-i-ova.xml | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml index 87bfab178a..93ceb803cc 100644 --- a/output/create_libvirt_xml.ml +++ b/output/create_libvirt_xml.ml @@ -435,13 +435,18 @@ let create_libvirt_xml ?pool source inspect let graphics match source.s_display with - | None -> e "graphics" [ "type", "vnc" ] [] + | None -> + e "graphics" [ "type", "vnc"; "autoport", "yes" ] [] | Some { s_display_type = Window } -> e "graphics" [ "type", "sdl" ] [] - | Some { s_display_type = VNC } -> - e "graphics" [ "type", "vnc" ] [] - | Some { s_display_type = Spice } -> - e "graphics" [ "type", "spice" ] [] in + | Some { s_display_type = VNC; s_port = Some p } -> + e "graphics" [ "type", "vnc"; "port", string_of_int p ] [] + | Some { s_display_type = VNC; s_port = None } -> + e "graphics" [ "type", "vnc"; "autoport", "yes" ] [] + | Some { s_display_type = Spice; s_port = Some p } -> + e "graphics" [ "type", "spice"; "port", string_of_int p ] [] + | Some { s_display_type = Spice; s_port = None } -> + e "graphics" [ "type", "spice"; "autoport", "yes" ] [] in (match source.s_display with | Some { s_keymap = Some km } -> append_attr ("keymap", km) graphics @@ -469,13 +474,6 @@ let create_libvirt_xml ?pool source inspect append_child sub graphics ) | None -> ()); - (match source.s_display with - | Some { s_port = Some p } -> - append_attr ("autoport", "no") graphics; - append_attr ("port", string_of_int p) graphics - | Some { s_port = None } | None -> - append_attr ("autoport", "yes") graphics; - append_attr ("port", "-1") graphics); List.push_back devices graphics; let sound diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml index 2b6a8de0f4..e72c1db396 100644 --- a/tests/test-v2v-i-ova.xml +++ b/tests/test-v2v-i-ova.xml @@ -41,7 +41,7 @@ <video> <model type='vga' vram='16384' heads='1'/> </video> - <graphics type='vnc' autoport='yes' port='-1'/> + <graphics type='vnc' autoport='yes'/> <rng model='virtio-transitional'> <backend model='random'>/dev/urandom</backend> </rng> -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 2/7] output: -o libvirt, qemu: Use correct device name for vsock
According to https://libvirt.org/formatdomain.html#vsock it's <vsock/> not <viosock/>. There is also no model="none", we just omit it if not present. According to https://wiki.qemu.org/Features/VirtioVsock the qemu parameter is -device vhost-vsock-pci. Fixes: 05f780c16f0135c657615520c2245b42de1efc3e --- output/create_libvirt_xml.ml | 8 ++------ output/output_qemu.ml | 4 +--- tests/test-v2v-i-ova.xml | 1 - 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/output/create_libvirt_xml.ml b/output/create_libvirt_xml.ml index 93ceb803cc..30c23973f7 100644 --- a/output/create_libvirt_xml.ml +++ b/output/create_libvirt_xml.ml @@ -511,12 +511,8 @@ let create_libvirt_xml ?pool source inspect e "address" ["type", "isa"; "iobase", "0x505"] [] ] ); - List.push_back devices ( - e "viosock" - ["model", - if guestcaps.gcaps_virtio_socket then virtio_model else "none"] - [] - ); + if guestcaps.gcaps_virtio_socket then + List.push_back devices (e "vsock" ["model", virtio_model] []); (* Standard devices added to every guest. *) List.push_back_list devices [ diff --git a/output/output_qemu.ml b/output/output_qemu.ml index 3d5d67820e..10ec89042b 100644 --- a/output/output_qemu.ml +++ b/output/output_qemu.ml @@ -277,9 +277,7 @@ and qemu_finalize dir source inspect target_meta if guestcaps.gcaps_isa_pvpanic then arg_list "-device" ["pvpanic"; "ioport=0x505"]; if guestcaps.gcaps_virtio_socket then - arg "-viosock" "virtio" - else - arg "-viosock" "none"; + arg "-device" "vhost-vsock-pci"; (* Add a serial console to Linux guests. *) if inspect.i_type = "linux" then diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml index e72c1db396..1915dd40af 100644 --- a/tests/test-v2v-i-ova.xml +++ b/tests/test-v2v-i-ova.xml @@ -46,7 +46,6 @@ <backend model='random'>/dev/urandom</backend> </rng> <memballoon model='virtio-transitional'/> - <viosock model='none'/> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <console type='pty'/> -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 3/7] tests: Drop some obsolete Fedora versions, start testing F35
For very old Fedora versions, it's no longer possible to download the packages (required by virt-builder --update). We get this error: Error: Cannot retrieve metalink for repository: fedora/20/x86_64. Please verify its path and try again I also dropped Fedora 23 and 29. Although those can be updated, it's not really worth testing long-obsolete versions of Fedora. More useful is testing the long-term stable equivalents (ie. CentOS and RHEL). I did however add the current version of Fedora (35) because it's worth testing that current Fedora conversions work. --- tests/Makefile.am | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 222b5872df..b4d3a5b5ab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -142,9 +142,7 @@ real_guests_scripts = \ test-v2v-conversion-of-debian-7.sh \ test-v2v-conversion-of-debian-8.sh \ test-v2v-conversion-of-debian-9.sh \ - test-v2v-conversion-of-fedora-20.sh \ - test-v2v-conversion-of-fedora-23.sh \ - test-v2v-conversion-of-fedora-29.sh \ + test-v2v-conversion-of-fedora-35.sh \ test-v2v-conversion-of-opensuse-13.1.sh \ test-v2v-conversion-of-opensuse-13.2.sh \ test-v2v-conversion-of-opensuse-42.1.sh \ -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 4/7] tests: Drop test of centos-6
The image cannot be updated, see error below. In any case we are testing a RHEL 6 image so it is not really necessary to continue to test CentOS 6. Loaded plugins: fastestmirror, security Setting up Update Process Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Invalid release/repo/arch combination/ removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt virt-builder: error: yum -y update: command exited with an error --- tests/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index b4d3a5b5ab..11c29676fe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -136,7 +136,6 @@ check-root: # try to convert. This is only used by 'make check-slow'. real_guests_scripts = \ - test-v2v-conversion-of-centos-6.sh \ test-v2v-conversion-of-centos-7.0.sh \ test-v2v-conversion-of-debian-6.sh \ test-v2v-conversion-of-debian-7.sh \ -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 5/7] tests: Drop ancient Ubuntu versions, add Ubuntu 20.04 LTS
Ubuntu 14.04 failed in the --update command. These versions are out of standard support (5 years) so drop them from testing. Add Ubuntu 20.04. --- tests/Makefile.am | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index 11c29676fe..3e828558d4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -149,11 +149,9 @@ real_guests_scripts = \ test-v2v-conversion-of-rhel-6.8.sh \ test-v2v-conversion-of-rhel-7.0.sh \ test-v2v-conversion-of-rhel-7.2.sh \ - test-v2v-conversion-of-ubuntu-10.04.sh \ - test-v2v-conversion-of-ubuntu-12.04.sh \ - test-v2v-conversion-of-ubuntu-14.04.sh \ test-v2v-conversion-of-ubuntu-16.04.sh \ test-v2v-conversion-of-ubuntu-18.04.sh \ + test-v2v-conversion-of-ubuntu-20.04.sh \ test-v2v-conversion-of-windows-6.2-server.sh \ test-v2v-conversion-of-windows-6.3-server.sh \ test-v2v-conversion-of-windows-10.0-server.sh -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 6/7] tests: Add newer RHEL versions to the tests
--- tests/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Makefile.am b/tests/Makefile.am index 3e828558d4..da57e786e9 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -149,6 +149,9 @@ real_guests_scripts = \ test-v2v-conversion-of-rhel-6.8.sh \ test-v2v-conversion-of-rhel-7.0.sh \ test-v2v-conversion-of-rhel-7.2.sh \ + test-v2v-conversion-of-rhel-7.9.sh \ + test-v2v-conversion-of-rhel-8.0.sh \ + test-v2v-conversion-of-rhel-8.4.sh \ test-v2v-conversion-of-ubuntu-16.04.sh \ test-v2v-conversion-of-ubuntu-18.04.sh \ test-v2v-conversion-of-ubuntu-20.04.sh \ -- 2.32.0
Richard W.M. Jones
2022-Jan-19 18:03 UTC
[Libguestfs] [PATCH v2v 7/7] tests: Don't use virt-builder --update when testing Windows conversions
The error was: virt-builder: error: cannot use ?--update? because no package manager has been detected for this guest OS. If this guest OS is a common one with ordinary package management then this may have been caused by a failure of libguestfs inspection. For OSes such as Windows that lack package management, this is not possible. Try using one of the ?--firstboot*? flags instead (described in the manual). --- tests/test-v2v-conversion-of.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test-v2v-conversion-of.sh b/tests/test-v2v-conversion-of.sh index 232c630057..5a974d1b74 100755 --- a/tests/test-v2v-conversion-of.sh +++ b/tests/test-v2v-conversion-of.sh @@ -61,8 +61,17 @@ case "$guestname" in ;; esac +# Don't try to update Windows versions. +case "$guestname" in + windows*) + ;; + *) + extra[${#extra[*]}]='--update' + ;; +esac + # Build a guest (using virt-builder). -virt-builder "$guestname" --quiet -o "$disk" "${extra[@]}" --update +virt-builder "$guestname" --quiet -o "$disk" "${extra[@]}" # Create some minimal test metadata. cat > "$xml" <<EOF -- 2.32.0