tests/functional: Add missing require_netdev('user') statements

A bunch of tests are using "-netdev user" but fail to check
for the availability of SLIRP in the binary, so these tests
fail if QEMU has been configured with "--disable-slirp"
(most of the tests are disabled by default with a decorator,
that's likely why nobody noticed this problem yet). Add the
missing self.require_netdev('user') statements to skip the
tests if SLIRP is not available.

Message-ID: <20250324123450.111307-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Thomas Huth 2025-03-24 13:34:50 +01:00
parent f0a6b3ec6d
commit dba0752f2c
7 changed files with 16 additions and 1 deletions

View file

@ -33,6 +33,7 @@ class Aarch64RMESbsaRefMachine(QemuSystemTest):
def test_aarch64_rme_sbsaref(self): def test_aarch64_rme_sbsaref(self):
self.set_machine('sbsa-ref') self.set_machine('sbsa-ref')
self.require_accelerator('tcg') self.require_accelerator('tcg')
self.require_netdev('user')
self.vm.set_console() self.vm.set_console()

View file

@ -60,8 +60,10 @@ class Aarch64RMEVirtMachine(QemuSystemTest):
# and launching a nested VM using it. # and launching a nested VM using it.
def test_aarch64_rme_virt(self): def test_aarch64_rme_virt(self):
self.set_machine('virt') self.set_machine('virt')
self.vm.set_console()
self.require_accelerator('tcg') self.require_accelerator('tcg')
self.require_netdev('user')
self.vm.set_console()
stack_path_tar_gz = self.ASSET_RME_STACK_VIRT.fetch() stack_path_tar_gz = self.ASSET_RME_STACK_VIRT.fetch()
self.archive_extract(stack_path_tar_gz, format="tar") self.archive_extract(stack_path_tar_gz, format="tar")

View file

@ -140,6 +140,8 @@ class BananaPiMachine(LinuxKernelTest):
@skipBigDataTest() @skipBigDataTest()
def test_arm_bpim2u_openwrt_22_03_3(self): def test_arm_bpim2u_openwrt_22_03_3(self):
self.set_machine('bpim2u') self.set_machine('bpim2u')
self.require_netdev('user')
# This test download a 8.9 MiB compressed image and expand it # This test download a 8.9 MiB compressed image and expand it
# to 127 MiB. # to 127 MiB.
image_path = self.uncompress(self.ASSET_SD_IMAGE) image_path = self.uncompress(self.ASSET_SD_IMAGE)

View file

@ -107,6 +107,8 @@ class CubieboardMachine(LinuxKernelTest):
# This test download a 7.5 MiB compressed image and expand it # This test download a 7.5 MiB compressed image and expand it
# to 126 MiB. # to 126 MiB.
self.set_machine('cubieboard') self.set_machine('cubieboard')
self.require_netdev('user')
image_path = self.uncompress(self.ASSET_OPENWRT) image_path = self.uncompress(self.ASSET_OPENWRT)
image_pow2ceil_expand(image_path) image_pow2ceil_expand(image_path)

View file

@ -147,6 +147,8 @@ class OrangePiMachine(LinuxKernelTest):
@skipBigDataTest() @skipBigDataTest()
def test_arm_orangepi_armbian(self): def test_arm_orangepi_armbian(self):
self.set_machine('orangepi-pc') self.set_machine('orangepi-pc')
self.require_netdev('user')
# This test download a 275 MiB compressed image and expand it # This test download a 275 MiB compressed image and expand it
# to 1036 MiB, but the underlying filesystem is 1552 MiB... # to 1036 MiB, but the underlying filesystem is 1552 MiB...
# As we expand it to 2 GiB we are safe. # As we expand it to 2 GiB we are safe.
@ -181,6 +183,8 @@ class OrangePiMachine(LinuxKernelTest):
@skipBigDataTest() @skipBigDataTest()
def test_arm_orangepi_uboot_netbsd9(self): def test_arm_orangepi_uboot_netbsd9(self):
self.set_machine('orangepi-pc') self.set_machine('orangepi-pc')
self.require_netdev('user')
# This test download a 304MB compressed image and expand it to 2GB # This test download a 304MB compressed image and expand it to 2GB
# We use the common OrangePi PC 'plus' build of U-Boot for our secondary # We use the common OrangePi PC 'plus' build of U-Boot for our secondary
# program loader (SPL). We will then set the path to the more specific # program loader (SPL). We will then set the path to the more specific

View file

@ -125,6 +125,7 @@ class HypervisorTest(QemuSystemTest):
def test_hv_pseries(self): def test_hv_pseries(self):
self.require_accelerator("tcg") self.require_accelerator("tcg")
self.require_netdev('user')
self.set_machine('pseries') self.set_machine('pseries')
self.vm.add_args("-accel", "tcg,thread=multi") self.vm.add_args("-accel", "tcg,thread=multi")
self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0') self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0')
@ -136,6 +137,7 @@ class HypervisorTest(QemuSystemTest):
def test_hv_pseries_kvm(self): def test_hv_pseries_kvm(self):
self.require_accelerator("kvm") self.require_accelerator("kvm")
self.require_netdev('user')
self.set_machine('pseries') self.set_machine('pseries')
self.vm.add_args("-accel", "kvm") self.vm.add_args("-accel", "kvm")
self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0') self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0')
@ -147,6 +149,7 @@ class HypervisorTest(QemuSystemTest):
def test_hv_powernv(self): def test_hv_powernv(self):
self.require_accelerator("tcg") self.require_accelerator("tcg")
self.require_netdev('user')
self.set_machine('powernv') self.set_machine('powernv')
self.vm.add_args("-accel", "tcg,thread=multi") self.vm.add_args("-accel", "tcg,thread=multi")
self.vm.add_args('-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234,drive=drive0', self.vm.add_args('-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234,drive=drive0',

View file

@ -41,6 +41,7 @@ class KVMXenGuest(QemuSystemTest):
def common_vm_setup(self): def common_vm_setup(self):
# We also catch lack of KVM_XEN support if we fail to launch # We also catch lack of KVM_XEN support if we fail to launch
self.require_accelerator("kvm") self.require_accelerator("kvm")
self.require_netdev('user')
self.vm.set_console() self.vm.set_console()