Skip to content

Commit dba0752

Browse files
committed
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: <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Signed-off-by: Thomas Huth <[email protected]>
1 parent f0a6b3e commit dba0752

File tree

7 files changed

+16
-1
lines changed

7 files changed

+16
-1
lines changed

tests/functional/test_aarch64_rme_sbsaref.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class Aarch64RMESbsaRefMachine(QemuSystemTest):
3333
def test_aarch64_rme_sbsaref(self):
3434
self.set_machine('sbsa-ref')
3535
self.require_accelerator('tcg')
36+
self.require_netdev('user')
3637

3738
self.vm.set_console()
3839

tests/functional/test_aarch64_rme_virt.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ class Aarch64RMEVirtMachine(QemuSystemTest):
6060
# and launching a nested VM using it.
6161
def test_aarch64_rme_virt(self):
6262
self.set_machine('virt')
63-
self.vm.set_console()
6463
self.require_accelerator('tcg')
64+
self.require_netdev('user')
65+
66+
self.vm.set_console()
6567

6668
stack_path_tar_gz = self.ASSET_RME_STACK_VIRT.fetch()
6769
self.archive_extract(stack_path_tar_gz, format="tar")

tests/functional/test_arm_bpim2u.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ def test_arm_bpim2u_gmac(self):
140140
@skipBigDataTest()
141141
def test_arm_bpim2u_openwrt_22_03_3(self):
142142
self.set_machine('bpim2u')
143+
self.require_netdev('user')
144+
143145
# This test download a 8.9 MiB compressed image and expand it
144146
# to 127 MiB.
145147
image_path = self.uncompress(self.ASSET_SD_IMAGE)

tests/functional/test_arm_cubieboard.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ def test_arm_cubieboard_openwrt_22_03_2(self):
107107
# This test download a 7.5 MiB compressed image and expand it
108108
# to 126 MiB.
109109
self.set_machine('cubieboard')
110+
self.require_netdev('user')
111+
110112
image_path = self.uncompress(self.ASSET_OPENWRT)
111113
image_pow2ceil_expand(image_path)
112114

tests/functional/test_arm_orangepi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ def test_arm_orangepi_sd(self):
147147
@skipBigDataTest()
148148
def test_arm_orangepi_armbian(self):
149149
self.set_machine('orangepi-pc')
150+
self.require_netdev('user')
151+
150152
# This test download a 275 MiB compressed image and expand it
151153
# to 1036 MiB, but the underlying filesystem is 1552 MiB...
152154
# As we expand it to 2 GiB we are safe.
@@ -181,6 +183,8 @@ def test_arm_orangepi_armbian(self):
181183
@skipBigDataTest()
182184
def test_arm_orangepi_uboot_netbsd9(self):
183185
self.set_machine('orangepi-pc')
186+
self.require_netdev('user')
187+
184188
# This test download a 304MB compressed image and expand it to 2GB
185189
# We use the common OrangePi PC 'plus' build of U-Boot for our secondary
186190
# program loader (SPL). We will then set the path to the more specific

tests/functional/test_ppc64_hv.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ def do_test_kvm(self, hpt=False):
125125

126126
def test_hv_pseries(self):
127127
self.require_accelerator("tcg")
128+
self.require_netdev('user')
128129
self.set_machine('pseries')
129130
self.vm.add_args("-accel", "tcg,thread=multi")
130131
self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0')
@@ -136,6 +137,7 @@ def test_hv_pseries(self):
136137

137138
def test_hv_pseries_kvm(self):
138139
self.require_accelerator("kvm")
140+
self.require_netdev('user')
139141
self.set_machine('pseries')
140142
self.vm.add_args("-accel", "kvm")
141143
self.vm.add_args('-device', 'nvme,serial=1234,drive=drive0')
@@ -147,6 +149,7 @@ def test_hv_pseries_kvm(self):
147149

148150
def test_hv_powernv(self):
149151
self.require_accelerator("tcg")
152+
self.require_netdev('user')
150153
self.set_machine('powernv')
151154
self.vm.add_args("-accel", "tcg,thread=multi")
152155
self.vm.add_args('-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234,drive=drive0',

tests/functional/test_x86_64_kvm_xen.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class KVMXenGuest(QemuSystemTest):
4141
def common_vm_setup(self):
4242
# We also catch lack of KVM_XEN support if we fail to launch
4343
self.require_accelerator("kvm")
44+
self.require_netdev('user')
4445

4546
self.vm.set_console()
4647

0 commit comments

Comments
 (0)