diff --git a/avocado-setup.py b/avocado-setup.py index 482c3bdf..a78cb1ac 100644 --- a/avocado-setup.py +++ b/avocado-setup.py @@ -114,6 +114,11 @@ def config(self): self.shortname) cmd = 'cp -f %s %s' % (local_cfg, cfg) os.system(cmd) + emulator = helper.get_qemu_emulator() + if emulator != '/usr/bin/qemu-system-ppc64': + cmd = "sed -i 's#/usr/bin/qemu-system-ppc64#%s#g' %s" % ( + emulator, cfg) + os.system(cmd) self.conf = cfg elif self.type == 'host': local_cfg = "%s/%s/%s.cfg" % (TEST_CONF_PATH, diff --git a/lib/helper.py b/lib/helper.py index 4e749ae3..9377d50b 100644 --- a/lib/helper.py +++ b/lib/helper.py @@ -231,6 +231,22 @@ def is_rhel8(): return False +def get_qemu_emulator(): + """ + Return the QEMU emulator binary to use for guest tests + + Older releases provide /usr/bin/qemu-system-ppc64, newer ones (RHEL 10 + and later) ship only /usr/libexec/qemu-kvm. + + :return: path of the emulator binary which exists on the host + """ + default = "/usr/bin/qemu-system-ppc64" + alternate = "/usr/libexec/qemu-kvm" + if not os.path.exists(default) and os.path.exists(alternate): + return alternate + return default + + def remove_file(src, dest): """ Remove Files from Destination Folder which is common in Source and Destination