]> git.proxmox.com Git - mirror_qemu.git/blob - tests/acceptance/boot_linux_console.py
tests/boot_linux_console: fix extract_from_deb() comment
[mirror_qemu.git] / tests / acceptance / boot_linux_console.py
1 # Functional test that boots a Linux kernel and checks the console
2 #
3 # Copyright (c) 2018 Red Hat, Inc.
4 #
5 # Author:
6 # Cleber Rosa <crosa@redhat.com>
7 #
8 # This work is licensed under the terms of the GNU GPL, version 2 or
9 # later. See the COPYING file in the top-level directory.
10
11 import os
12 import lzma
13 import gzip
14 import shutil
15
16 from avocado import skipUnless
17 from avocado_qemu import Test
18 from avocado_qemu import exec_command_and_wait_for_pattern
19 from avocado_qemu import wait_for_console_pattern
20 from avocado.utils import process
21 from avocado.utils import archive
22
23
24 class BootLinuxConsole(Test):
25 """
26 Boots a Linux kernel and checks that the console is operational and the
27 kernel command line is properly passed from QEMU to the kernel
28 """
29
30 timeout = 90
31
32 KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
33
34 def wait_for_console_pattern(self, success_message):
35 wait_for_console_pattern(self, success_message,
36 failure_message='Kernel panic - not syncing')
37
38 def extract_from_deb(self, deb, path):
39 """
40 Extracts a file from a deb package into the test workdir
41
42 :param deb: path to the deb archive
43 :param path: path within the deb archive of the file to be extracted
44 :returns: path of the extracted file
45 """
46 cwd = os.getcwd()
47 os.chdir(self.workdir)
48 file_path = process.run("ar t %s" % deb).stdout_text.split()[2]
49 process.run("ar x %s %s" % (deb, file_path))
50 archive.extract(file_path, self.workdir)
51 os.chdir(cwd)
52 # Return complete path to extracted file. Because callers to
53 # extract_from_deb() specify 'path' with a leading slash, it is
54 # necessary to use os.path.relpath() as otherwise os.path.join()
55 # interprets it as an absolute path and drops the self.workdir part.
56 return os.path.normpath(os.path.join(self.workdir,
57 os.path.relpath(path, '/')))
58
59 def extract_from_rpm(self, rpm, path):
60 """
61 Extracts a file from an RPM package into the test workdir.
62
63 :param rpm: path to the rpm archive
64 :param path: path within the rpm archive of the file to be extracted
65 needs to be a relative path (starting with './') because
66 cpio(1), which is used to extract the file, expects that.
67 :returns: path of the extracted file
68 """
69 cwd = os.getcwd()
70 os.chdir(self.workdir)
71 process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True)
72 os.chdir(cwd)
73 return os.path.normpath(os.path.join(self.workdir, path))
74
75 def test_x86_64_pc(self):
76 """
77 :avocado: tags=arch:x86_64
78 :avocado: tags=machine:pc
79 """
80 kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
81 '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
82 '/vmlinuz')
83 kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
84 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
85
86 self.vm.set_console()
87 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
88 self.vm.add_args('-kernel', kernel_path,
89 '-append', kernel_command_line)
90 self.vm.launch()
91 console_pattern = 'Kernel command line: %s' % kernel_command_line
92 self.wait_for_console_pattern(console_pattern)
93
94 def test_mips_malta(self):
95 """
96 :avocado: tags=arch:mips
97 :avocado: tags=machine:malta
98 :avocado: tags=endian:big
99 """
100 deb_url = ('http://snapshot.debian.org/archive/debian/'
101 '20130217T032700Z/pool/main/l/linux-2.6/'
102 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb')
103 deb_hash = 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04'
104 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
105 kernel_path = self.extract_from_deb(deb_path,
106 '/boot/vmlinux-2.6.32-5-4kc-malta')
107
108 self.vm.set_console()
109 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
110 self.vm.add_args('-kernel', kernel_path,
111 '-append', kernel_command_line)
112 self.vm.launch()
113 console_pattern = 'Kernel command line: %s' % kernel_command_line
114 self.wait_for_console_pattern(console_pattern)
115
116 def test_mips64el_malta(self):
117 """
118 This test requires the ar tool to extract "data.tar.gz" from
119 the Debian package.
120
121 The kernel can be rebuilt using this Debian kernel source [1] and
122 following the instructions on [2].
123
124 [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/
125 #linux-source-2.6.32_2.6.32-48
126 [2] https://kernel-team.pages.debian.net/kernel-handbook/
127 ch-common-tasks.html#s-common-official
128
129 :avocado: tags=arch:mips64el
130 :avocado: tags=machine:malta
131 """
132 deb_url = ('http://snapshot.debian.org/archive/debian/'
133 '20130217T032700Z/pool/main/l/linux-2.6/'
134 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb')
135 deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5'
136 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
137 kernel_path = self.extract_from_deb(deb_path,
138 '/boot/vmlinux-2.6.32-5-5kc-malta')
139
140 self.vm.set_console()
141 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
142 self.vm.add_args('-kernel', kernel_path,
143 '-append', kernel_command_line)
144 self.vm.launch()
145 console_pattern = 'Kernel command line: %s' % kernel_command_line
146 self.wait_for_console_pattern(console_pattern)
147
148 def test_mips_malta_cpio(self):
149 """
150 :avocado: tags=arch:mips
151 :avocado: tags=machine:malta
152 :avocado: tags=endian:big
153 """
154 deb_url = ('http://snapshot.debian.org/archive/debian/'
155 '20160601T041800Z/pool/main/l/linux/'
156 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb')
157 deb_hash = 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8'
158 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
159 kernel_path = self.extract_from_deb(deb_path,
160 '/boot/vmlinux-4.5.0-2-4kc-malta')
161 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
162 '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
163 'mips/rootfs.cpio.gz')
164 initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99'
165 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
166 initrd_path = self.workdir + "rootfs.cpio"
167 archive.gzip_uncompress(initrd_path_gz, initrd_path)
168
169 self.vm.set_console()
170 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
171 + 'console=ttyS0 console=tty '
172 + 'rdinit=/sbin/init noreboot')
173 self.vm.add_args('-kernel', kernel_path,
174 '-initrd', initrd_path,
175 '-append', kernel_command_line,
176 '-no-reboot')
177 self.vm.launch()
178 self.wait_for_console_pattern('Boot successful.')
179
180 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
181 'BogoMIPS')
182 exec_command_and_wait_for_pattern(self, 'uname -a',
183 'Debian')
184 exec_command_and_wait_for_pattern(self, 'reboot',
185 'reboot: Restarting system')
186
187 @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
188 def test_mips64el_malta_5KEc_cpio(self):
189 """
190 :avocado: tags=arch:mips64el
191 :avocado: tags=machine:malta
192 :avocado: tags=endian:little
193 """
194 kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
195 'raw/9ad2df38/mips/malta/mips64el/'
196 'vmlinux-3.19.3.mtoman.20150408')
197 kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
198 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
199 initrd_url = ('https://github.com/groeck/linux-build-test/'
200 'raw/8584a59e/rootfs/'
201 'mipsel64/rootfs.mipsel64r1.cpio.gz')
202 initrd_hash = '1dbb8a396e916847325284dbe2151167'
203 initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
204 asset_hash=initrd_hash)
205 initrd_path = self.workdir + "rootfs.cpio"
206 archive.gzip_uncompress(initrd_path_gz, initrd_path)
207
208 self.vm.set_console()
209 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
210 + 'console=ttyS0 console=tty '
211 + 'rdinit=/sbin/init noreboot')
212 self.vm.add_args('-cpu', '5KEc',
213 '-kernel', kernel_path,
214 '-initrd', initrd_path,
215 '-append', kernel_command_line,
216 '-no-reboot')
217 self.vm.launch()
218 wait_for_console_pattern(self, 'Boot successful.')
219
220 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
221 'MIPS 5KE')
222 exec_command_and_wait_for_pattern(self, 'uname -a',
223 '3.19.3.mtoman.20150408')
224 exec_command_and_wait_for_pattern(self, 'reboot',
225 'reboot: Restarting system')
226
227 def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
228 kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
229 kernel_path = self.workdir + "kernel"
230 with lzma.open(kernel_path_xz, 'rb') as f_in:
231 with open(kernel_path, 'wb') as f_out:
232 shutil.copyfileobj(f_in, f_out)
233
234 self.vm.set_console()
235 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
236 + 'mem=256m@@0x0 '
237 + 'console=ttyS0')
238 self.vm.add_args('-no-reboot',
239 '-cpu', 'I7200',
240 '-kernel', kernel_path,
241 '-append', kernel_command_line)
242 self.vm.launch()
243 console_pattern = 'Kernel command line: %s' % kernel_command_line
244 self.wait_for_console_pattern(console_pattern)
245
246 def test_mips_malta32el_nanomips_4k(self):
247 """
248 :avocado: tags=arch:mipsel
249 :avocado: tags=machine:malta
250 :avocado: tags=endian:little
251 """
252 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
253 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
254 'generic_nano32r6el_page4k.xz')
255 kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
256 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
257
258 def test_mips_malta32el_nanomips_16k_up(self):
259 """
260 :avocado: tags=arch:mipsel
261 :avocado: tags=machine:malta
262 :avocado: tags=endian:little
263 """
264 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
265 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
266 'generic_nano32r6el_page16k_up.xz')
267 kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
268 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
269
270 def test_mips_malta32el_nanomips_64k_dbg(self):
271 """
272 :avocado: tags=arch:mipsel
273 :avocado: tags=machine:malta
274 :avocado: tags=endian:little
275 """
276 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
277 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
278 'generic_nano32r6el_page64k_dbg.xz')
279 kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
280 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
281
282 def test_aarch64_virt(self):
283 """
284 :avocado: tags=arch:aarch64
285 :avocado: tags=machine:virt
286 """
287 kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
288 '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
289 '/vmlinuz')
290 kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
291 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
292
293 self.vm.set_console()
294 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
295 'console=ttyAMA0')
296 self.vm.add_args('-cpu', 'cortex-a53',
297 '-kernel', kernel_path,
298 '-append', kernel_command_line)
299 self.vm.launch()
300 console_pattern = 'Kernel command line: %s' % kernel_command_line
301 self.wait_for_console_pattern(console_pattern)
302
303 def test_arm_virt(self):
304 """
305 :avocado: tags=arch:arm
306 :avocado: tags=machine:virt
307 """
308 kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
309 '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
310 '/vmlinuz')
311 kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
312 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
313
314 self.vm.set_console()
315 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
316 'console=ttyAMA0')
317 self.vm.add_args('-kernel', kernel_path,
318 '-append', kernel_command_line)
319 self.vm.launch()
320 console_pattern = 'Kernel command line: %s' % kernel_command_line
321 self.wait_for_console_pattern(console_pattern)
322
323 def test_arm_emcraft_sf2(self):
324 """
325 :avocado: tags=arch:arm
326 :avocado: tags=machine:emcraft-sf2
327 :avocado: tags=endian:little
328 """
329 uboot_url = ('https://raw.githubusercontent.com/'
330 'Subbaraya-Sundeep/qemu-test-binaries/'
331 'fa030bd77a014a0b8e360d3b7011df89283a2f0b/u-boot')
332 uboot_hash = 'abba5d9c24cdd2d49cdc2a8aa92976cf20737eff'
333 uboot_path = self.fetch_asset(uboot_url, asset_hash=uboot_hash)
334 spi_url = ('https://raw.githubusercontent.com/'
335 'Subbaraya-Sundeep/qemu-test-binaries/'
336 'fa030bd77a014a0b8e360d3b7011df89283a2f0b/spi.bin')
337 spi_hash = '85f698329d38de63aea6e884a86fbde70890a78a'
338 spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash)
339
340 self.vm.set_console()
341 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
342 self.vm.add_args('-kernel', uboot_path,
343 '-append', kernel_command_line,
344 '-drive', 'file=' + spi_path + ',if=mtd,format=raw',
345 '-no-reboot')
346 self.vm.launch()
347 self.wait_for_console_pattern('init started: BusyBox')
348
349 def do_test_arm_raspi2(self, uart_id):
350 """
351 The kernel can be rebuilt using the kernel source referenced
352 and following the instructions on the on:
353 https://www.raspberrypi.org/documentation/linux/kernel/building.md
354 """
355 serial_kernel_cmdline = {
356 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
357 }
358 deb_url = ('http://archive.raspberrypi.org/debian/'
359 'pool/main/r/raspberrypi-firmware/'
360 'raspberrypi-kernel_1.20190215-1_armhf.deb')
361 deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
362 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
363 kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
364 dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
365
366 self.vm.set_console()
367 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
368 serial_kernel_cmdline[uart_id])
369 self.vm.add_args('-kernel', kernel_path,
370 '-dtb', dtb_path,
371 '-append', kernel_command_line)
372 self.vm.launch()
373 console_pattern = 'Kernel command line: %s' % kernel_command_line
374 self.wait_for_console_pattern(console_pattern)
375
376 def test_arm_raspi2_uart0(self):
377 """
378 :avocado: tags=arch:arm
379 :avocado: tags=machine:raspi2
380 :avocado: tags=device:pl011
381 """
382 self.do_test_arm_raspi2(0)
383
384 def test_arm_exynos4210_initrd(self):
385 """
386 :avocado: tags=arch:arm
387 :avocado: tags=machine:smdkc210
388 """
389 deb_url = ('https://snapshot.debian.org/archive/debian/'
390 '20190928T224601Z/pool/main/l/linux/'
391 'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
392 deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
393 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
394 kernel_path = self.extract_from_deb(deb_path,
395 '/boot/vmlinuz-4.19.0-6-armmp')
396 dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
397 dtb_path = self.extract_from_deb(deb_path, dtb_path)
398
399 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
400 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
401 'arm/rootfs-armv5.cpio.gz')
402 initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
403 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
404 initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
405 archive.gzip_uncompress(initrd_path_gz, initrd_path)
406
407 self.vm.set_console()
408 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
409 'earlycon=exynos4210,0x13800000 earlyprintk ' +
410 'console=ttySAC0,115200n8 ' +
411 'random.trust_cpu=off cryptomgr.notests ' +
412 'cpuidle.off=1 panic=-1 noreboot')
413
414 self.vm.add_args('-kernel', kernel_path,
415 '-dtb', dtb_path,
416 '-initrd', initrd_path,
417 '-append', kernel_command_line,
418 '-no-reboot')
419 self.vm.launch()
420
421 self.wait_for_console_pattern('Boot successful.')
422 # TODO user command, for now the uart is stuck
423
424 def test_arm_cubieboard_initrd(self):
425 """
426 :avocado: tags=arch:arm
427 :avocado: tags=machine:cubieboard
428 """
429 deb_url = ('https://apt.armbian.com/pool/main/l/'
430 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
431 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
432 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
433 kernel_path = self.extract_from_deb(deb_path,
434 '/boot/vmlinuz-4.20.7-sunxi')
435 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
436 dtb_path = self.extract_from_deb(deb_path, dtb_path)
437 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
438 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
439 'arm/rootfs-armv5.cpio.gz')
440 initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
441 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
442 initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
443 archive.gzip_uncompress(initrd_path_gz, initrd_path)
444
445 self.vm.set_console()
446 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
447 'console=ttyS0,115200 '
448 'usbcore.nousb '
449 'panic=-1 noreboot')
450 self.vm.add_args('-kernel', kernel_path,
451 '-dtb', dtb_path,
452 '-initrd', initrd_path,
453 '-append', kernel_command_line,
454 '-no-reboot')
455 self.vm.launch()
456 self.wait_for_console_pattern('Boot successful.')
457
458 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
459 'Allwinner sun4i/sun5i')
460 exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
461 'system-control@1c00000')
462 exec_command_and_wait_for_pattern(self, 'reboot',
463 'reboot: Restarting system')
464
465 def test_arm_cubieboard_sata(self):
466 """
467 :avocado: tags=arch:arm
468 :avocado: tags=machine:cubieboard
469 """
470 deb_url = ('https://apt.armbian.com/pool/main/l/'
471 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
472 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
473 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
474 kernel_path = self.extract_from_deb(deb_path,
475 '/boot/vmlinuz-4.20.7-sunxi')
476 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
477 dtb_path = self.extract_from_deb(deb_path, dtb_path)
478 rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
479 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
480 'arm/rootfs-armv5.ext2.gz')
481 rootfs_hash = '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
482 rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
483 rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
484 archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
485
486 self.vm.set_console()
487 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
488 'console=ttyS0,115200 '
489 'usbcore.nousb '
490 'root=/dev/sda ro '
491 'panic=-1 noreboot')
492 self.vm.add_args('-kernel', kernel_path,
493 '-dtb', dtb_path,
494 '-drive', 'if=none,format=raw,id=disk0,file='
495 + rootfs_path,
496 '-device', 'ide-hd,bus=ide.0,drive=disk0',
497 '-append', kernel_command_line,
498 '-no-reboot')
499 self.vm.launch()
500 self.wait_for_console_pattern('Boot successful.')
501
502 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
503 'Allwinner sun4i/sun5i')
504 exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
505 'sda')
506 exec_command_and_wait_for_pattern(self, 'reboot',
507 'reboot: Restarting system')
508
509 def test_s390x_s390_ccw_virtio(self):
510 """
511 :avocado: tags=arch:s390x
512 :avocado: tags=machine:s390-ccw-virtio
513 """
514 kernel_url = ('https://archives.fedoraproject.org/pub/archive'
515 '/fedora-secondary/releases/29/Everything/s390x/os/images'
516 '/kernel.img')
517 kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313'
518 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
519
520 self.vm.set_console()
521 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0'
522 self.vm.add_args('-nodefaults',
523 '-kernel', kernel_path,
524 '-append', kernel_command_line)
525 self.vm.launch()
526 console_pattern = 'Kernel command line: %s' % kernel_command_line
527 self.wait_for_console_pattern(console_pattern)
528
529 def test_alpha_clipper(self):
530 """
531 :avocado: tags=arch:alpha
532 :avocado: tags=machine:clipper
533 """
534 kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/'
535 'installer-alpha/current/images/cdrom/vmlinuz')
536 kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3'
537 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
538
539 uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
540
541 self.vm.set_console()
542 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
543 self.vm.add_args('-vga', 'std',
544 '-kernel', uncompressed_kernel,
545 '-append', kernel_command_line)
546 self.vm.launch()
547 console_pattern = 'Kernel command line: %s' % kernel_command_line
548 self.wait_for_console_pattern(console_pattern)
549
550 def test_ppc64_pseries(self):
551 """
552 :avocado: tags=arch:ppc64
553 :avocado: tags=machine:pseries
554 """
555 kernel_url = ('https://archives.fedoraproject.org/pub/archive'
556 '/fedora-secondary/releases/29/Everything/ppc64le/os'
557 '/ppc/ppc64/vmlinuz')
558 kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
559 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
560
561 self.vm.set_console()
562 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
563 self.vm.add_args('-kernel', kernel_path,
564 '-append', kernel_command_line)
565 self.vm.launch()
566 console_pattern = 'Kernel command line: %s' % kernel_command_line
567 self.wait_for_console_pattern(console_pattern)
568
569 def test_m68k_q800(self):
570 """
571 :avocado: tags=arch:m68k
572 :avocado: tags=machine:q800
573 """
574 deb_url = ('https://snapshot.debian.org/archive/debian-ports'
575 '/20191021T083923Z/pool-m68k/main'
576 '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
577 deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
578 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
579 kernel_path = self.extract_from_deb(deb_path,
580 '/boot/vmlinux-5.3.0-1-m68k')
581
582 self.vm.set_console()
583 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
584 'console=ttyS0 vga=off')
585 self.vm.add_args('-kernel', kernel_path,
586 '-append', kernel_command_line)
587 self.vm.launch()
588 console_pattern = 'Kernel command line: %s' % kernel_command_line
589 self.wait_for_console_pattern(console_pattern)
590 console_pattern = 'No filesystem could mount root'
591 self.wait_for_console_pattern(console_pattern)