From 8ca3f5db64ace91097f56a0a376e2524b744bf99 Mon Sep 17 00:00:00 2001 From: Julia Graham Date: Fri, 6 Sep 2024 15:49:46 -0400 Subject: [PATCH] Boot_order: ensure only 1 repo is used to get boot.iso Issue: VMStartError: VM 'avocado-vt-vm1' failed to start: error: Failed to start domain 'avocado-vt-vm1'error: Cannot access storage file '/var/lib/avocado/data/avocado-vt/boot.iso': No such file or directory(exit status: 1) Fix: This issue is caused by multiple repos being fetched and then their urls being concatenated together. The fix is to ensure that only 1 repo is fetched (the last result), which can in turn get the boot.iso file. --- .../src/guest_os_booting/boot_order/boot_from_cdrom_device.py | 2 +- .../guest_os_booting/boot_order/boot_with_multiple_boot_dev.py | 2 +- .../boot_order/boot_with_multiple_boot_order.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt/tests/src/guest_os_booting/boot_order/boot_from_cdrom_device.py b/libvirt/tests/src/guest_os_booting/boot_order/boot_from_cdrom_device.py index 8a675f0b5a..e2f6d7b13d 100644 --- a/libvirt/tests/src/guest_os_booting/boot_order/boot_from_cdrom_device.py +++ b/libvirt/tests/src/guest_os_booting/boot_order/boot_from_cdrom_device.py @@ -30,7 +30,7 @@ def parse_cdroms_attrs(params): cdrom_attrs_list.append(cdrom2_attrs) if cdrom1_attrs.get('source') or cdrom2_attrs.get('source'): - cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'" + cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'" repo_url = process.run(cmd, shell=True).stdout_text.strip() boot_img_url = os.path.join(repo_url, 'images', 'boot.iso') if os.path.exists(boot_img_path): diff --git a/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_dev.py b/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_dev.py index 46087f1462..2afb6b432b 100644 --- a/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_dev.py +++ b/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_dev.py @@ -47,7 +47,7 @@ def prepare_device(params, vm_name, bootable_device): libvirt_vmxml.modify_vm_device(vmxml, 'disk', disk_dict) if bootable_device == "cdrom_bootable": cdrom_path = os.path.join(data_dir.get_data_dir(), 'images', 'boot.iso') - cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'" + cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'" repo_url = process.run(cmd, shell=True).stdout_text.strip() boot_img_url = os.path.join(repo_url, 'images', 'boot.iso') download.get_file(boot_img_url, cdrom_path) diff --git a/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_order.py b/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_order.py index ba470396fb..6dc8b2704b 100644 --- a/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_order.py +++ b/libvirt/tests/src/guest_os_booting/boot_order/boot_with_multiple_boot_order.py @@ -42,7 +42,7 @@ def prepare_device_attrs(params, vm_name, bootable_device): file_list.append(disk_image) if bootable_device == "cdrom_bootable": cdrom_path = os.path.join(data_dir.get_data_dir(), 'images', 'boot.iso') - cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {print $NF}'" + cmd = "dnf repolist -v enabled |awk '/Repo-baseurl.*composes.*BaseOS.*os/ {res=$NF} END{print res}'" repo_url = process.run(cmd, shell=True).stdout_text.strip() boot_img_url = os.path.join(repo_url, 'images', 'boot.iso') download.get_file(boot_img_url, cdrom_path)