1 # Functional test that boots a Linux kernel and checks the console
3 # Copyright (c) 2018 Red Hat, Inc.
6 # Cleber Rosa <crosa@redhat.com>
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.
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
24 class BootLinuxConsole(Test
):
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
32 KERNEL_COMMON_COMMAND_LINE
= 'printk.time=0 '
34 def wait_for_console_pattern(self
, success_message
):
35 wait_for_console_pattern(self
, success_message
,
36 failure_message
='Kernel panic - not syncing')
38 def extract_from_deb(self
, deb
, path
):
40 Extracts a file from a deb package into the test workdir
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
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
)
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
, '/')))
59 def extract_from_rpm(self
, rpm
, path
):
61 Extracts a file from an RPM package into the test workdir.
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
70 os
.chdir(self
.workdir
)
71 process
.run("rpm2cpio %s | cpio -id %s" % (rpm
, path
), shell
=True)
73 return os
.path
.normpath(os
.path
.join(self
.workdir
, path
))
75 def test_x86_64_pc(self
):
77 :avocado: tags=arch:x86_64
78 :avocado: tags=machine:pc
80 kernel_url
= ('https://archives.fedoraproject.org/pub/archive/fedora'
81 '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
83 kernel_hash
= '23bebd2680757891cf7adedb033532163a792495'
84 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
87 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
88 self
.vm
.add_args('-kernel', kernel_path
,
89 '-append', kernel_command_line
)
91 console_pattern
= 'Kernel command line: %s' % kernel_command_line
92 self
.wait_for_console_pattern(console_pattern
)
94 def test_mips_malta(self
):
96 :avocado: tags=arch:mips
97 :avocado: tags=machine:malta
98 :avocado: tags=endian:big
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')
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
)
113 console_pattern
= 'Kernel command line: %s' % kernel_command_line
114 self
.wait_for_console_pattern(console_pattern
)
116 def test_mips64el_malta(self
):
118 This test requires the ar tool to extract "data.tar.gz" from
121 The kernel can be rebuilt using this Debian kernel source [1] and
122 following the instructions on [2].
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
129 :avocado: tags=arch:mips64el
130 :avocado: tags=machine:malta
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')
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
)
145 console_pattern
= 'Kernel command line: %s' % kernel_command_line
146 self
.wait_for_console_pattern(console_pattern
)
148 def test_mips_malta_cpio(self
):
150 :avocado: tags=arch:mips
151 :avocado: tags=machine:malta
152 :avocado: tags=endian:big
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
)
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
,
178 self
.wait_for_console_pattern('Boot successful.')
180 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
182 exec_command_and_wait_for_pattern(self
, 'uname -a',
184 exec_command_and_wait_for_pattern(self
, 'reboot',
185 'reboot: Restarting system')
187 @skipUnless(os
.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
188 def test_mips64el_malta_5KEc_cpio(self
):
190 :avocado: tags=arch:mips64el
191 :avocado: tags=machine:malta
192 :avocado: tags=endian:little
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
)
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
,
218 wait_for_console_pattern(self
, 'Boot successful.')
220 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
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')
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
)
234 self
.vm
.set_console()
235 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
238 self
.vm
.add_args('-no-reboot',
240 '-kernel', kernel_path
,
241 '-append', kernel_command_line
)
243 console_pattern
= 'Kernel command line: %s' % kernel_command_line
244 self
.wait_for_console_pattern(console_pattern
)
246 def test_mips_malta32el_nanomips_4k(self
):
248 :avocado: tags=arch:mipsel
249 :avocado: tags=machine:malta
250 :avocado: tags=endian:little
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
)
258 def test_mips_malta32el_nanomips_16k_up(self
):
260 :avocado: tags=arch:mipsel
261 :avocado: tags=machine:malta
262 :avocado: tags=endian:little
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
)
270 def test_mips_malta32el_nanomips_64k_dbg(self
):
272 :avocado: tags=arch:mipsel
273 :avocado: tags=machine:malta
274 :avocado: tags=endian:little
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
)
282 def test_aarch64_virt(self
):
284 :avocado: tags=arch:aarch64
285 :avocado: tags=machine:virt
287 kernel_url
= ('https://archives.fedoraproject.org/pub/archive/fedora'
288 '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
290 kernel_hash
= '8c73e469fc6ea06a58dc83a628fc695b693b8493'
291 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
293 self
.vm
.set_console()
294 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
296 self
.vm
.add_args('-cpu', 'cortex-a53',
297 '-kernel', kernel_path
,
298 '-append', kernel_command_line
)
300 console_pattern
= 'Kernel command line: %s' % kernel_command_line
301 self
.wait_for_console_pattern(console_pattern
)
303 def test_arm_virt(self
):
305 :avocado: tags=arch:arm
306 :avocado: tags=machine:virt
308 kernel_url
= ('https://archives.fedoraproject.org/pub/archive/fedora'
309 '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
311 kernel_hash
= 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
312 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
314 self
.vm
.set_console()
315 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
317 self
.vm
.add_args('-kernel', kernel_path
,
318 '-append', kernel_command_line
)
320 console_pattern
= 'Kernel command line: %s' % kernel_command_line
321 self
.wait_for_console_pattern(console_pattern
)
323 def test_arm_emcraft_sf2(self
):
325 :avocado: tags=arch:arm
326 :avocado: tags=machine:emcraft-sf2
327 :avocado: tags=endian:little
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
)
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',
347 self
.wait_for_console_pattern('init started: BusyBox')
349 def do_test_arm_raspi2(self
, uart_id
):
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
355 serial_kernel_cmdline
= {
356 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
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')
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
,
371 '-append', kernel_command_line
)
373 console_pattern
= 'Kernel command line: %s' % kernel_command_line
374 self
.wait_for_console_pattern(console_pattern
)
376 def test_arm_raspi2_uart0(self
):
378 :avocado: tags=arch:arm
379 :avocado: tags=machine:raspi2
380 :avocado: tags=device:pl011
382 self
.do_test_arm_raspi2(0)
384 def test_arm_exynos4210_initrd(self
):
386 :avocado: tags=arch:arm
387 :avocado: tags=machine:smdkc210
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
)
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
)
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')
414 self
.vm
.add_args('-kernel', kernel_path
,
416 '-initrd', initrd_path
,
417 '-append', kernel_command_line
,
421 self
.wait_for_console_pattern('Boot successful.')
422 # TODO user command, for now the uart is stuck
424 def test_arm_cubieboard_initrd(self
):
426 :avocado: tags=arch:arm
427 :avocado: tags=machine:cubieboard
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
)
445 self
.vm
.set_console()
446 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
447 'console=ttyS0,115200 '
450 self
.vm
.add_args('-kernel', kernel_path
,
452 '-initrd', initrd_path
,
453 '-append', kernel_command_line
,
456 self
.wait_for_console_pattern('Boot successful.')
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')
465 def test_arm_cubieboard_sata(self
):
467 :avocado: tags=arch:arm
468 :avocado: tags=machine:cubieboard
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
)
486 self
.vm
.set_console()
487 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
488 'console=ttyS0,115200 '
492 self
.vm
.add_args('-kernel', kernel_path
,
494 '-drive', 'if=none,format=raw,id=disk0,file='
496 '-device', 'ide-hd,bus=ide.0,drive=disk0',
497 '-append', kernel_command_line
,
500 self
.wait_for_console_pattern('Boot successful.')
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',
506 exec_command_and_wait_for_pattern(self
, 'reboot',
507 'reboot: Restarting system')
509 def test_s390x_s390_ccw_virtio(self
):
511 :avocado: tags=arch:s390x
512 :avocado: tags=machine:s390-ccw-virtio
514 kernel_url
= ('https://archives.fedoraproject.org/pub/archive'
515 '/fedora-secondary/releases/29/Everything/s390x/os/images'
517 kernel_hash
= 'e8e8439103ef8053418ef062644ffd46a7919313'
518 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
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
)
526 console_pattern
= 'Kernel command line: %s' % kernel_command_line
527 self
.wait_for_console_pattern(console_pattern
)
529 def test_alpha_clipper(self
):
531 :avocado: tags=arch:alpha
532 :avocado: tags=machine:clipper
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
)
539 uncompressed_kernel
= archive
.uncompress(kernel_path
, self
.workdir
)
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
)
547 console_pattern
= 'Kernel command line: %s' % kernel_command_line
548 self
.wait_for_console_pattern(console_pattern
)
550 def test_ppc64_pseries(self
):
552 :avocado: tags=arch:ppc64
553 :avocado: tags=machine:pseries
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
)
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
)
566 console_pattern
= 'Kernel command line: %s' % kernel_command_line
567 self
.wait_for_console_pattern(console_pattern
)
569 def test_m68k_q800(self
):
571 :avocado: tags=arch:m68k
572 :avocado: tags=machine:q800
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')
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
)
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
)