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)