diff --git a/tests/functional/vfio/gha-run.sh b/tests/functional/vfio/gha-run.sh index cfd8082249..97c72f80b7 100755 --- a/tests/functional/vfio/gha-run.sh +++ b/tests/functional/vfio/gha-run.sh @@ -15,6 +15,28 @@ source "${vfio_dir}/../../common.bash" function install_dependencies() { info "Installing the dependencies needed for running the vfio tests" + ( + source /etc/os-release || source /usr/lib/os-release + case "${ID}" in + ubuntu) + # cloud image dependencies + deps=(xorriso curl qemu-utils openssh-client) + + sudo apt-get update + sudo apt-get install -y ${deps[@]} qemu-system-x86 + ;; + fedora) + # cloud image dependencies + deps=(xorriso curl qemu-img openssh) + + sudo dnf install -y ${deps[@]} qemu-system-x86-core + ;; + + "*") + die "Unsupported distro: ${ID}" + ;; + esac + ) } function run() { diff --git a/tests/functional/vfio/vfio_fedora_vm_wrapper.sh b/tests/functional/vfio/vfio_fedora_vm_wrapper.sh index bdebbeb800..e3fbf855e5 100755 --- a/tests/functional/vfio/vfio_fedora_vm_wrapper.sh +++ b/tests/functional/vfio/vfio_fedora_vm_wrapper.sh @@ -244,30 +244,6 @@ run_vm() { -device virtio-net-pci,netdev=net1,disable-legacy=on,disable-modern="${disable_modern}",iommu_platform=on,ats=on } -install_dependencies() { - case "${ID}" in - ubuntu) - # cloud image dependencies - deps=(xorriso curl qemu-utils openssh-client) - - sudo apt-get update - sudo apt-get install -y ${deps[@]} - sudo apt-get install --reinstall -y qemu-system-x86 - ;; - fedora) - # cloud image dependencies - deps=(xorriso curl qemu-img openssh) - - sudo dnf install -y ${deps[@]} qemu-system-x86-core - sudo dnf reinstall -y qemu-system-x86-core - ;; - - "*") - die "Unsupported distro: ${ID}" - ;; - esac -} - ssh_vm() { cmd=$@ ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o IdentitiesOnly=yes -i "${ssh_key_file}" -p "${vm_port}" "${USER}@${vm_ip}" "${cmd}" @@ -298,8 +274,6 @@ main() { mkdir -p "${data_dir}" - install_dependencies - create_ssh_key create_config_iso "${config_iso_file}"