1
Convert the intel_iommu test to the new functional framework.
1
Convert the intel_iommu test to the new functional framework.
2
This test needs some changes since we neither support the old 'LinuxTest'
2
This test needs some changes since we neither support the old 'LinuxTest'
3
class in the functional framework yet, nor a way to use SSH for running
3
class in the functional framework yet, nor a way to use SSH for running
4
commands in the guest. So we now directly download a Fedora kernel and
4
commands in the guest. So we now directly download a Fedora kernel and
5
initrd and set up the serial console for executing the commands and for
5
initrd and set up the serial console for executing the commands and for
6
looking for the results.
6
looking for the results. Instead of configuring the cloud image via
7
cloud-init, we now simply mount the file system manually from an initrd
8
rescue shell.
9
10
While the old test was exercising the network with a "dnf install"
11
command (which is not the best option for the CI since this depends
12
on third party servers), the new code is now setting up a little
13
HTTP server in the guest and transfers a file from the guest to the
14
host instead.
15
16
The test should now run much faster and more reliable (since we
17
don't depend on the third party servers for "dnf install" anymore),
18
so we can also drop the @skipUnless decorator now.
7
19
8
Signed-off-by: Thomas Huth <thuth@redhat.com>
20
Signed-off-by: Thomas Huth <thuth@redhat.com>
9
---
21
---
10
MAINTAINERS | 1 +
22
v2:
11
tests/functional/meson.build | 1 +
23
- Download the cloud image qcow2 and use it as file system
12
.../test_intel_iommu.py} | 119 ++++++++----------
24
to exercise the virtio-block device
13
3 files changed, 51 insertions(+), 70 deletions(-)
25
- Instead of removing the "dnf install", transfer a file
14
rename tests/{avocado/intel_iommu.py => functional/test_intel_iommu.py} (41%)
26
via virtio-net to the host
15
mode change 100644 => 100755
27
- This needs find_free_port() now:
28
Based-on: <20241204071911.664057-1-thuth@redhat.com>
29
30
MAINTAINERS | 1 +
31
tests/avocado/intel_iommu.py | 122 -------------------
32
tests/functional/meson.build | 2 +
33
tests/functional/test_intel_iommu.py | 176 +++++++++++++++++++++++++++
34
4 files changed, 179 insertions(+), 122 deletions(-)
35
delete mode 100644 tests/avocado/intel_iommu.py
36
create mode 100755 tests/functional/test_intel_iommu.py
16
37
17
diff --git a/MAINTAINERS b/MAINTAINERS
38
diff --git a/MAINTAINERS b/MAINTAINERS
18
index XXXXXXX..XXXXXXX 100644
39
index XXXXXXX..XXXXXXX 100644
19
--- a/MAINTAINERS
40
--- a/MAINTAINERS
20
+++ b/MAINTAINERS
41
+++ b/MAINTAINERS
...
...
24
F: include/hw/i386/intel_iommu.h
45
F: include/hw/i386/intel_iommu.h
25
+F: tests/functional/test_intel_iommu.py
46
+F: tests/functional/test_intel_iommu.py
26
47
27
AMD-Vi Emulation
48
AMD-Vi Emulation
28
S: Orphan
49
S: Orphan
29
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
50
diff --git a/tests/avocado/intel_iommu.py b/tests/avocado/intel_iommu.py
30
index XXXXXXX..XXXXXXX 100644
51
deleted file mode 100644
31
--- a/tests/functional/meson.build
32
+++ b/tests/functional/meson.build
33
@@ -XXX,XX +XXX,XX @@ tests_x86_64_system_quick = [
34
35
tests_x86_64_system_thorough = [
36
'acpi_bits',
37
+ 'intel_iommu',
38
'x86_64_tuxrun',
39
'linux_initrd',
40
'multiprocess',
41
diff --git a/tests/avocado/intel_iommu.py b/tests/functional/test_intel_iommu.py
42
old mode 100644
43
new mode 100755
44
similarity index 41%
45
rename from tests/avocado/intel_iommu.py
46
rename to tests/functional/test_intel_iommu.py
47
index XXXXXXX..XXXXXXX
52
index XXXXXXX..XXXXXXX
48
--- a/tests/avocado/intel_iommu.py
53
--- a/tests/avocado/intel_iommu.py
49
+++ b/tests/functional/test_intel_iommu.py
54
+++ /dev/null
50
@@ -XXX,XX +XXX,XX @@
55
@@ -XXX,XX +XXX,XX @@
51
+#!/usr/bin/env python3
56
-# INTEL_IOMMU Functional tests
52
+#
57
-#
53
# INTEL_IOMMU Functional tests
58
-# Copyright (c) 2021 Red Hat, Inc.
54
#
59
-#
55
# Copyright (c) 2021 Red Hat, Inc.
60
-# Author:
56
@@ -XXX,XX +XXX,XX @@
61
-# Eric Auger <eric.auger@redhat.com>
57
#
62
-#
58
# This work is licensed under the terms of the GNU GPL, version 2 or
63
-# This work is licensed under the terms of the GNU GPL, version 2 or
59
# later. See the COPYING file in the top-level directory.
64
-# later. See the COPYING file in the top-level directory.
60
-import os
65
-import os
61
66
-
62
-from avocado import skipUnless
67
-from avocado import skipUnless
63
-from avocado_qemu.linuxtest import LinuxTest
68
-from avocado_qemu.linuxtest import LinuxTest
64
+from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pattern
69
-
65
+
66
+class IntelIOMMU(LinuxKernelTest):
67
68
-@skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
70
-@skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
69
-class IntelIOMMU(LinuxTest):
71
-class IntelIOMMU(LinuxTest):
70
- """
72
- """
71
- :avocado: tags=arch:x86_64
73
- :avocado: tags=arch:x86_64
72
- :avocado: tags=distro:fedora
74
- :avocado: tags=distro:fedora
73
- :avocado: tags=distro_version:31
75
- :avocado: tags=distro_version:31
74
- :avocado: tags=machine:q35
76
- :avocado: tags=machine:q35
75
- :avocado: tags=accel:kvm
77
- :avocado: tags=accel:kvm
76
- :avocado: tags=intel_iommu
78
- :avocado: tags=intel_iommu
77
- :avocado: tags=flaky
79
- :avocado: tags=flaky
78
- """
80
- """
79
+ ASSET_KERNEL = Asset(
81
-
80
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
82
- IOMMU_ADDON = ',iommu_platform=on,disable-modern=off,disable-legacy=on'
81
+ 'releases/39/Server/x86_64/os/images/pxeboot/vmlinuz'),
83
- kernel_path = None
82
+ '5f2ef0de47f8d79d5ee9bf8b0ee6d5ba4d987c2f9a16b8b511a7c69e53931fe3')
84
- initrd_path = None
83
+
85
- kernel_params = None
84
+ ASSET_INITRD = Asset(
86
-
85
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/'
86
+ 'releases/39/Server/x86_64/os/images/pxeboot/initrd.img'),
87
+ '5bc29e2d872ceeb39a9698d42da3fb0afd7583dc7180de05a6b78bcc726674bb')
88
89
IOMMU_ADDON = ',iommu_platform=on,disable-modern=off,disable-legacy=on'
90
+ default_kernel_params = 'console=ttyS0 rd.rescue quiet '
91
kernel_path = None
92
initrd_path = None
93
kernel_params = None
94
95
- def set_up_boot(self):
87
- def set_up_boot(self):
96
- path = self.download_boot()
88
- path = self.download_boot()
97
- self.vm.add_args('-device', 'virtio-blk-pci,bus=pcie.0,' +
89
- self.vm.add_args('-device', 'virtio-blk-pci,bus=pcie.0,' +
98
- 'drive=drv0,id=virtio-disk0,bootindex=1,'
90
- 'drive=drv0,id=virtio-disk0,bootindex=1,'
99
- 'werror=stop,rerror=stop' + self.IOMMU_ADDON)
91
- 'werror=stop,rerror=stop' + self.IOMMU_ADDON)
...
...
102
- 'file=%s,if=none,cache=writethrough,id=drv0' % path)
94
- 'file=%s,if=none,cache=writethrough,id=drv0' % path)
103
-
95
-
104
- def setUp(self):
96
- def setUp(self):
105
- super(IntelIOMMU, self).setUp(None, 'virtio-net-pci' + self.IOMMU_ADDON)
97
- super(IntelIOMMU, self).setUp(None, 'virtio-net-pci' + self.IOMMU_ADDON)
106
-
98
-
107
def add_common_args(self):
99
- def add_common_args(self):
108
self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
100
- self.vm.add_args('-device', 'virtio-rng-pci,rng=rng0')
109
self.vm.add_args('-object',
101
- self.vm.add_args('-object',
110
'rng-random,id=rng0,filename=/dev/urandom')
102
- 'rng-random,id=rng0,filename=/dev/urandom')
111
+ self.vm.add_args('-device', 'virtio-net-pci' + self.IOMMU_ADDON)
103
-
112
+ self.vm.add_args('-device', 'virtio-gpu-pci' + self.IOMMU_ADDON)
113
+ self.vm.add_args("-m", "1G")
114
115
- def common_vm_setup(self, custom_kernel=None):
104
- def common_vm_setup(self, custom_kernel=None):
116
+ def common_vm_setup(self):
105
- self.require_accelerator("kvm")
117
+ self.set_machine('q35')
106
- self.add_common_args()
118
self.require_accelerator("kvm")
107
- self.vm.add_args("-accel", "kvm")
119
self.add_common_args()
108
-
120
self.vm.add_args("-accel", "kvm")
121
122
- if custom_kernel is None:
109
- if custom_kernel is None:
123
- return
110
- return
124
-
111
-
125
- kernel_url = self.distro.pxeboot_url + 'vmlinuz'
112
- kernel_url = self.distro.pxeboot_url + 'vmlinuz'
126
- kernel_hash = '5b6f6876e1b5bda314f93893271da0d5777b1f3c'
113
- kernel_hash = '5b6f6876e1b5bda314f93893271da0d5777b1f3c'
127
- initrd_url = self.distro.pxeboot_url + 'initrd.img'
114
- initrd_url = self.distro.pxeboot_url + 'initrd.img'
128
- initrd_hash = 'dd0340a1b39bd28f88532babd4581c67649ec5b1'
115
- initrd_hash = 'dd0340a1b39bd28f88532babd4581c67649ec5b1'
129
- self.kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
116
- self.kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
130
- self.initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
117
- self.initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
131
+ self.kernel_path = self.ASSET_KERNEL.fetch()
118
-
132
+ self.initrd_path = self.ASSET_INITRD.fetch()
119
- def run_and_check(self):
133
+ self.kernel_params = self.default_kernel_params
120
- if self.kernel_path:
134
121
- self.vm.add_args('-kernel', self.kernel_path,
135
def run_and_check(self):
122
- '-append', self.kernel_params,
136
if self.kernel_path:
123
- '-initrd', self.initrd_path)
137
self.vm.add_args('-kernel', self.kernel_path,
138
'-append', self.kernel_params,
139
'-initrd', self.initrd_path)
140
- self.launch_and_wait()
124
- self.launch_and_wait()
141
- self.ssh_command('cat /proc/cmdline')
125
- self.ssh_command('cat /proc/cmdline')
142
- self.ssh_command('dmesg | grep -e DMAR -e IOMMU')
126
- self.ssh_command('dmesg | grep -e DMAR -e IOMMU')
143
- self.ssh_command('find /sys/kernel/iommu_groups/ -type l')
127
- self.ssh_command('find /sys/kernel/iommu_groups/ -type l')
144
- self.ssh_command('dnf -y install numactl-devel')
128
- self.ssh_command('dnf -y install numactl-devel')
129
-
130
- def test_intel_iommu(self):
131
- """
132
- :avocado: tags=intel_iommu_intremap
133
- """
134
-
135
- self.common_vm_setup(True)
136
- self.vm.add_args('-device', 'intel-iommu,intremap=on')
137
- self.vm.add_args('-machine', 'kernel_irqchip=split')
138
-
139
- self.kernel_params = (self.distro.default_kernel_params +
140
- ' quiet intel_iommu=on')
141
- self.run_and_check()
142
-
143
- def test_intel_iommu_strict(self):
144
- """
145
- :avocado: tags=intel_iommu_strict
146
- """
147
-
148
- self.common_vm_setup(True)
149
- self.vm.add_args('-device', 'intel-iommu,intremap=on')
150
- self.vm.add_args('-machine', 'kernel_irqchip=split')
151
- self.kernel_params = (self.distro.default_kernel_params +
152
- ' quiet intel_iommu=on,strict')
153
- self.run_and_check()
154
-
155
- def test_intel_iommu_strict_cm(self):
156
- """
157
- :avocado: tags=intel_iommu_strict_cm
158
- """
159
-
160
- self.common_vm_setup(True)
161
- self.vm.add_args('-device', 'intel-iommu,intremap=on,caching-mode=on')
162
- self.vm.add_args('-machine', 'kernel_irqchip=split')
163
- self.kernel_params = (self.distro.default_kernel_params +
164
- ' quiet intel_iommu=on,strict')
165
- self.run_and_check()
166
-
167
- def test_intel_iommu_pt(self):
168
- """
169
- :avocado: tags=intel_iommu_pt
170
- """
171
-
172
- self.common_vm_setup(True)
173
- self.vm.add_args('-device', 'intel-iommu,intremap=on')
174
- self.vm.add_args('-machine', 'kernel_irqchip=split')
175
- self.kernel_params = (self.distro.default_kernel_params +
176
- ' quiet intel_iommu=on iommu=pt')
177
- self.run_and_check()
178
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
179
index XXXXXXX..XXXXXXX 100644
180
--- a/tests/functional/meson.build
181
+++ b/tests/functional/meson.build
182
@@ -XXX,XX +XXX,XX @@ test_timeouts = {
183
'arm_raspi2' : 120,
184
'arm_tuxrun' : 240,
185
'arm_sx1' : 360,
186
+ 'intel_iommu': 300,
187
'mips_malta' : 120,
188
'netdev_ethtool' : 180,
189
'ppc_40p' : 240,
190
@@ -XXX,XX +XXX,XX @@ tests_x86_64_system_quick = [
191
192
tests_x86_64_system_thorough = [
193
'acpi_bits',
194
+ 'intel_iommu',
195
'x86_64_tuxrun',
196
'linux_initrd',
197
'multiprocess',
198
diff --git a/tests/functional/test_intel_iommu.py b/tests/functional/test_intel_iommu.py
199
new file mode 100755
200
index XXXXXXX..XXXXXXX
201
--- /dev/null
202
+++ b/tests/functional/test_intel_iommu.py
203
@@ -XXX,XX +XXX,XX @@
204
+#!/usr/bin/env python3
205
+#
206
+# INTEL_IOMMU Functional tests
207
+#
208
+# Copyright (c) 2021 Red Hat, Inc.
209
+#
210
+# Author:
211
+# Eric Auger <eric.auger@redhat.com>
212
+#
213
+# This work is licensed under the terms of the GNU GPL, version 2 or
214
+# later. See the COPYING file in the top-level directory.
215
+
216
+import hashlib
217
+import urllib.request
218
+
219
+from qemu_test import LinuxKernelTest, Asset, exec_command_and_wait_for_pattern
220
+from qemu_test.ports import Ports
221
+
222
+class IntelIOMMU(LinuxKernelTest):
223
+
224
+ ASSET_KERNEL = Asset(
225
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/releases'
226
+ '/31/Server/x86_64/os/images/pxeboot/vmlinuz'),
227
+ 'd4738d03dbbe083ca610d0821d0a8f1488bebbdccef54ce33e3adb35fda00129')
228
+
229
+ ASSET_INITRD = Asset(
230
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/releases'
231
+ '/31/Server/x86_64/os/images/pxeboot/initrd.img'),
232
+ '277cd6c7adf77c7e63d73bbb2cded8ef9e2d3a2f100000e92ff1f8396513cd8b')
233
+
234
+ ASSET_DISKIMAGE = Asset(
235
+ ('https://archives.fedoraproject.org/pub/archive/fedora/linux/releases'
236
+ '/31/Cloud/x86_64/images/Fedora-Cloud-Base-31-1.9.x86_64.qcow2'),
237
+ 'e3c1b309d9203604922d6e255c2c5d098a309c2d46215d8fc026954f3c5c27a0')
238
+
239
+ default_kernel_params = ('root=/dev/vda1 console=ttyS0 net.ifnames=0 '
240
+ 'quiet rd.rescue ')
241
+ IOMMU_ADDON = ',iommu_platform=on,disable-modern=off,disable-legacy=on'
242
+ kernel_path = None
243
+ initrd_path = None
244
+ kernel_params = None
245
+
246
+ def add_common_args(self, path):
247
+ self.vm.add_args('-drive', f'file={path},if=none,id=drv0,snapshot=on')
248
+ self.vm.add_args('-device', 'virtio-blk-pci,bus=pcie.0,' +
249
+ 'drive=drv0,id=virtio-disk0,bootindex=1,'
250
+ 'werror=stop,rerror=stop' + self.IOMMU_ADDON)
251
+ self.vm.add_args('-device', 'virtio-gpu-pci' + self.IOMMU_ADDON)
252
+ self.vm.add_args('-device', 'virtio-rng-pci,rng=r0')
253
+ self.vm.add_args('-object', 'rng-random,id=r0,filename=/dev/urandom')
254
+ self.vm.add_args("-m", "1G")
255
+ self.vm.add_args("-accel", "kvm")
256
+
257
+ def common_vm_setup(self):
258
+ self.set_machine('q35')
259
+ self.require_accelerator("kvm")
260
+ self.require_netdev('user')
261
+
262
+ self.kernel_path = self.ASSET_KERNEL.fetch()
263
+ self.initrd_path = self.ASSET_INITRD.fetch()
264
+ image_path = self.ASSET_DISKIMAGE.fetch()
265
+ self.add_common_args(image_path)
266
+ self.kernel_params = self.default_kernel_params
267
+
268
+ def add_nic_args(self, hostport):
269
+ self.vm.add_args('-netdev',
270
+ 'user,id=n1,hostfwd=tcp::%d-:8080' % hostport)
271
+ self.vm.add_args('-device',
272
+ 'virtio-net-pci,netdev=n1' + self.IOMMU_ADDON)
273
+
274
+ def run_and_check(self, freeport):
275
+ self.add_nic_args(freeport)
276
+
277
+ if self.kernel_path:
278
+ self.vm.add_args('-kernel', self.kernel_path,
279
+ '-append', self.kernel_params,
280
+ '-initrd', self.initrd_path)
145
+ self.vm.set_console()
281
+ self.vm.set_console()
146
+ self.vm.launch()
282
+ self.vm.launch()
147
+ self.wait_for_console_pattern('(or press Control-D to continue):')
283
+ self.wait_for_console_pattern('Entering emergency mode.')
148
+ prompt = ':/root#'
284
+ prompt = '# '
149
+ exec_command_and_wait_for_pattern(self, '', prompt)
285
+ self.wait_for_console_pattern(prompt)
286
+
287
+ # Copy a file (checked later), umount afterwards to drop disk cache:
288
+ exec_command_and_wait_for_pattern(self, 'mount /dev/vda1 /sysroot',
289
+ prompt)
290
+ filename = '/boot/initramfs-5.3.7-301.fc31.x86_64.img'
291
+ exec_command_and_wait_for_pattern(self, (f'cp /sysroot{filename}'
292
+ ' /sysroot/root/data'),
293
+ prompt)
294
+ exec_command_and_wait_for_pattern(self, 'umount /sysroot', prompt)
295
+
296
+ # Switch from initrd to the cloud image filesystem:
297
+ exec_command_and_wait_for_pattern(self, 'mount /dev/vda1 /sysroot',
298
+ prompt)
299
+ exec_command_and_wait_for_pattern(self,
300
+ ('for d in dev proc sys run ; do '
301
+ 'mount -o bind /$d /sysroot/$d ; done'), prompt)
302
+ exec_command_and_wait_for_pattern(self, 'chroot /sysroot', prompt)
303
+
304
+ # Checking for IOMMU enablement:
305
+ self.log.info("Checking whether IOMMU has been enabled...")
150
+ exec_command_and_wait_for_pattern(self, 'cat /proc/cmdline',
306
+ exec_command_and_wait_for_pattern(self, 'cat /proc/cmdline',
151
+ 'intel_iommu=on')
307
+ 'intel_iommu=on')
152
+ self.wait_for_console_pattern(prompt)
308
+ self.wait_for_console_pattern(prompt)
153
+ exec_command_and_wait_for_pattern(self, 'dmesg | grep DMAR:',
309
+ exec_command_and_wait_for_pattern(self, 'dmesg | grep DMAR:',
154
+ 'IOMMU enabled')
310
+ 'IOMMU enabled')
155
+ self.wait_for_console_pattern(prompt)
311
+ self.wait_for_console_pattern(prompt)
156
+ exec_command_and_wait_for_pattern(self,
312
+ exec_command_and_wait_for_pattern(self,
157
+ 'find /sys/kernel/iommu_groups/ -type l',
313
+ 'find /sys/kernel/iommu_groups/ -type l',
158
+ 'devices/0000:00:')
314
+ 'devices/0000:00:')
159
+ self.wait_for_console_pattern(prompt)
315
+ self.wait_for_console_pattern(prompt)
160
316
+
161
def test_intel_iommu(self):
317
+ # Check hard disk device via sha256sum:
162
- """
318
+ self.log.info("Checking hard disk...")
163
- :avocado: tags=intel_iommu_intremap
319
+ hashsum = '0dc7472f879be70b2f3daae279e3ae47175ffe249691e7d97f47222b65b8a720'
164
- """
320
+ exec_command_and_wait_for_pattern(self, 'sha256sum ' + filename,
165
-
321
+ hashsum)
166
- self.common_vm_setup(True)
322
+ self.wait_for_console_pattern(prompt)
323
+ exec_command_and_wait_for_pattern(self, 'sha256sum /root/data',
324
+ hashsum)
325
+ self.wait_for_console_pattern(prompt)
326
+
327
+ # Check virtio-net via HTTP:
328
+ exec_command_and_wait_for_pattern(self, 'dhclient eth0', prompt)
329
+ exec_command_and_wait_for_pattern(self,
330
+ 'python3 -m http.server 8080 & sleep 1',
331
+ 'Serving HTTP on 0.0.0.0 port 8080')
332
+ hl = hashlib.sha256()
333
+ url = f'http://localhost:{freeport}{filename}'
334
+ self.log.info(f'Downloading {url} ...')
335
+ with urllib.request.urlopen(url) as response:
336
+ while True:
337
+ chunk = response.read(1 << 20)
338
+ if not chunk:
339
+ break
340
+ hl.update(chunk)
341
+
342
+ digest = hl.hexdigest()
343
+ self.log.info(f'sha256sum of download is {digest}.')
344
+ self.assertEqual(digest, hashsum)
345
+
346
+ def test_intel_iommu(self):
167
+ self.common_vm_setup()
347
+ self.common_vm_setup()
168
self.vm.add_args('-device', 'intel-iommu,intremap=on')
348
+ self.vm.add_args('-device', 'intel-iommu,intremap=on')
169
self.vm.add_args('-machine', 'kernel_irqchip=split')
349
+ self.vm.add_args('-machine', 'kernel_irqchip=split')
170
-
171
- self.kernel_params = (self.distro.default_kernel_params +
172
- ' quiet intel_iommu=on')
173
+ self.kernel_params += 'intel_iommu=on'
350
+ self.kernel_params += 'intel_iommu=on'
174
self.run_and_check()
351
+ with Ports() as ports:
175
352
+ self.run_and_check(ports.find_free_port())
176
def test_intel_iommu_strict(self):
353
+
177
- """
354
+ def test_intel_iommu_strict(self):
178
- :avocado: tags=intel_iommu_strict
179
- """
180
-
181
- self.common_vm_setup(True)
182
+ self.common_vm_setup()
355
+ self.common_vm_setup()
183
self.vm.add_args('-device', 'intel-iommu,intremap=on')
356
+ self.vm.add_args('-device', 'intel-iommu,intremap=on')
184
self.vm.add_args('-machine', 'kernel_irqchip=split')
357
+ self.vm.add_args('-machine', 'kernel_irqchip=split')
185
- self.kernel_params = (self.distro.default_kernel_params +
186
- ' quiet intel_iommu=on,strict')
187
+ self.kernel_params += 'intel_iommu=on,strict'
358
+ self.kernel_params += 'intel_iommu=on,strict'
188
self.run_and_check()
359
+ with Ports() as ports:
189
360
+ self.run_and_check(ports.find_free_port())
190
def test_intel_iommu_strict_cm(self):
361
+
191
- """
362
+ def test_intel_iommu_strict_cm(self):
192
- :avocado: tags=intel_iommu_strict_cm
193
- """
194
-
195
- self.common_vm_setup(True)
196
+ self.common_vm_setup()
363
+ self.common_vm_setup()
197
self.vm.add_args('-device', 'intel-iommu,intremap=on,caching-mode=on')
364
+ self.vm.add_args('-device', 'intel-iommu,intremap=on,caching-mode=on')
198
self.vm.add_args('-machine', 'kernel_irqchip=split')
365
+ self.vm.add_args('-machine', 'kernel_irqchip=split')
199
- self.kernel_params = (self.distro.default_kernel_params +
200
- ' quiet intel_iommu=on,strict')
201
+ self.kernel_params += 'intel_iommu=on,strict'
366
+ self.kernel_params += 'intel_iommu=on,strict'
202
self.run_and_check()
367
+ with Ports() as ports:
203
368
+ self.run_and_check(ports.find_free_port())
204
def test_intel_iommu_pt(self):
369
+
205
- """
370
+ def test_intel_iommu_pt(self):
206
- :avocado: tags=intel_iommu_pt
207
- """
208
-
209
- self.common_vm_setup(True)
210
+ self.common_vm_setup()
371
+ self.common_vm_setup()
211
self.vm.add_args('-device', 'intel-iommu,intremap=on')
372
+ self.vm.add_args('-device', 'intel-iommu,intremap=on')
212
self.vm.add_args('-machine', 'kernel_irqchip=split')
373
+ self.vm.add_args('-machine', 'kernel_irqchip=split')
213
- self.kernel_params = (self.distro.default_kernel_params +
214
- ' quiet intel_iommu=on iommu=pt')
215
+ self.kernel_params += 'intel_iommu=on iommu=pt'
374
+ self.kernel_params += 'intel_iommu=on iommu=pt'
216
self.run_and_check()
375
+ with Ports() as ports:
376
+ self.run_and_check(ports.find_free_port())
217
+
377
+
218
+if __name__ == '__main__':
378
+if __name__ == '__main__':
219
+ LinuxKernelTest.main()
379
+ LinuxKernelTest.main()
220
--
380
--
221
2.47.1
381
2.47.1
diff view generated by jsdifflib