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 skip
17 from avocado
import skipUnless
18 from avocado
import skipUnless
19 from avocado_qemu
import QemuSystemTest
20 from avocado_qemu
import exec_command
21 from avocado_qemu
import exec_command_and_wait_for_pattern
22 from avocado_qemu
import interrupt_interactive_console_until_pattern
23 from avocado_qemu
import wait_for_console_pattern
24 from avocado
.utils
import process
25 from avocado
.utils
import archive
28 Round up to next power of 2
31 return 1 if x
== 0 else 2**(x
- 1).bit_length()
33 def file_truncate(path
, size
):
34 if size
!= os
.path
.getsize(path
):
35 with
open(path
, 'ab+') as fd
:
39 Expand file size to next power of 2
41 def image_pow2ceil_expand(path
):
42 size
= os
.path
.getsize(path
)
43 size_aligned
= pow2ceil(size
)
44 if size
!= size_aligned
:
45 with
open(path
, 'ab+') as fd
:
46 fd
.truncate(size_aligned
)
48 class LinuxKernelTest(QemuSystemTest
):
49 KERNEL_COMMON_COMMAND_LINE
= 'printk.time=0 '
51 def wait_for_console_pattern(self
, success_message
, vm
=None):
52 wait_for_console_pattern(self
, success_message
,
53 failure_message
='Kernel panic - not syncing',
56 def extract_from_deb(self
, deb
, path
):
58 Extracts a file from a deb package into the test workdir
60 :param deb: path to the deb archive
61 :param path: path within the deb archive of the file to be extracted
62 :returns: path of the extracted file
65 os
.chdir(self
.workdir
)
66 file_path
= process
.run("ar t %s" % deb
).stdout_text
.split()[2]
67 process
.run("ar x %s %s" % (deb
, file_path
))
68 archive
.extract(file_path
, self
.workdir
)
70 # Return complete path to extracted file. Because callers to
71 # extract_from_deb() specify 'path' with a leading slash, it is
72 # necessary to use os.path.relpath() as otherwise os.path.join()
73 # interprets it as an absolute path and drops the self.workdir part.
74 return os
.path
.normpath(os
.path
.join(self
.workdir
,
75 os
.path
.relpath(path
, '/')))
77 def extract_from_rpm(self
, rpm
, path
):
79 Extracts a file from an RPM package into the test workdir.
81 :param rpm: path to the rpm archive
82 :param path: path within the rpm archive of the file to be extracted
83 needs to be a relative path (starting with './') because
84 cpio(1), which is used to extract the file, expects that.
85 :returns: path of the extracted file
88 os
.chdir(self
.workdir
)
89 process
.run("rpm2cpio %s | cpio -id %s" % (rpm
, path
), shell
=True)
91 return os
.path
.normpath(os
.path
.join(self
.workdir
, path
))
93 class BootLinuxConsole(LinuxKernelTest
):
95 Boots a Linux kernel and checks that the console is operational and the
96 kernel command line is properly passed from QEMU to the kernel
100 def test_x86_64_pc(self
):
102 :avocado: tags=arch:x86_64
103 :avocado: tags=machine:pc
105 kernel_url
= ('https://archives.fedoraproject.org/pub/archive/fedora'
106 '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
108 kernel_hash
= '23bebd2680757891cf7adedb033532163a792495'
109 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
111 self
.vm
.set_console()
112 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
113 self
.vm
.add_args('-kernel', kernel_path
,
114 '-append', kernel_command_line
)
116 console_pattern
= 'Kernel command line: %s' % kernel_command_line
117 self
.wait_for_console_pattern(console_pattern
)
119 def test_mips_malta(self
):
121 :avocado: tags=arch:mips
122 :avocado: tags=machine:malta
123 :avocado: tags=endian:big
125 deb_url
= ('http://snapshot.debian.org/archive/debian/'
126 '20130217T032700Z/pool/main/l/linux-2.6/'
127 'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb')
128 deb_hash
= 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04'
129 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
130 kernel_path
= self
.extract_from_deb(deb_path
,
131 '/boot/vmlinux-2.6.32-5-4kc-malta')
133 self
.vm
.set_console()
134 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
135 self
.vm
.add_args('-kernel', kernel_path
,
136 '-append', kernel_command_line
)
138 console_pattern
= 'Kernel command line: %s' % kernel_command_line
139 self
.wait_for_console_pattern(console_pattern
)
141 def test_mips64el_malta(self
):
143 This test requires the ar tool to extract "data.tar.gz" from
146 The kernel can be rebuilt using this Debian kernel source [1] and
147 following the instructions on [2].
149 [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/
150 #linux-source-2.6.32_2.6.32-48
151 [2] https://kernel-team.pages.debian.net/kernel-handbook/
152 ch-common-tasks.html#s-common-official
154 :avocado: tags=arch:mips64el
155 :avocado: tags=machine:malta
157 deb_url
= ('http://snapshot.debian.org/archive/debian/'
158 '20130217T032700Z/pool/main/l/linux-2.6/'
159 'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb')
160 deb_hash
= '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5'
161 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
162 kernel_path
= self
.extract_from_deb(deb_path
,
163 '/boot/vmlinux-2.6.32-5-5kc-malta')
165 self
.vm
.set_console()
166 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
167 self
.vm
.add_args('-kernel', kernel_path
,
168 '-append', kernel_command_line
)
170 console_pattern
= 'Kernel command line: %s' % kernel_command_line
171 self
.wait_for_console_pattern(console_pattern
)
173 def test_mips64el_fuloong2e(self
):
175 :avocado: tags=arch:mips64el
176 :avocado: tags=machine:fuloong2e
177 :avocado: tags=endian:little
179 deb_url
= ('http://archive.debian.org/debian/pool/main/l/linux/'
180 'linux-image-3.16.0-6-loongson-2e_3.16.56-1+deb8u1_mipsel.deb')
181 deb_hash
= 'd04d446045deecf7b755ef576551de0c4184dd44'
182 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
183 kernel_path
= self
.extract_from_deb(deb_path
,
184 '/boot/vmlinux-3.16.0-6-loongson-2e')
186 self
.vm
.set_console()
187 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
188 self
.vm
.add_args('-kernel', kernel_path
,
189 '-append', kernel_command_line
)
191 console_pattern
= 'Kernel command line: %s' % kernel_command_line
192 self
.wait_for_console_pattern(console_pattern
)
194 def test_mips_malta_cpio(self
):
196 :avocado: tags=arch:mips
197 :avocado: tags=machine:malta
198 :avocado: tags=endian:big
200 deb_url
= ('http://snapshot.debian.org/archive/debian/'
201 '20160601T041800Z/pool/main/l/linux/'
202 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb')
203 deb_hash
= 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8'
204 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
205 kernel_path
= self
.extract_from_deb(deb_path
,
206 '/boot/vmlinux-4.5.0-2-4kc-malta')
207 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
208 '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
209 'mips/rootfs.cpio.gz')
210 initrd_hash
= 'bf806e17009360a866bf537f6de66590de349a99'
211 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
212 initrd_path
= self
.workdir
+ "rootfs.cpio"
213 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
215 self
.vm
.set_console()
216 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
217 + 'console=ttyS0 console=tty '
218 + 'rdinit=/sbin/init noreboot')
219 self
.vm
.add_args('-kernel', kernel_path
,
220 '-initrd', initrd_path
,
221 '-append', kernel_command_line
,
224 self
.wait_for_console_pattern('Boot successful.')
226 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
228 exec_command_and_wait_for_pattern(self
, 'uname -a',
230 exec_command_and_wait_for_pattern(self
, 'reboot',
231 'reboot: Restarting system')
232 # Wait for VM to shut down gracefully
235 @skipUnless(os
.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
236 def test_mips64el_malta_5KEc_cpio(self
):
238 :avocado: tags=arch:mips64el
239 :avocado: tags=machine:malta
240 :avocado: tags=endian:little
241 :avocado: tags=cpu:5KEc
243 kernel_url
= ('https://github.com/philmd/qemu-testing-blob/'
244 'raw/9ad2df38/mips/malta/mips64el/'
245 'vmlinux-3.19.3.mtoman.20150408')
246 kernel_hash
= '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
247 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
248 initrd_url
= ('https://github.com/groeck/linux-build-test/'
249 'raw/8584a59e/rootfs/'
250 'mipsel64/rootfs.mipsel64r1.cpio.gz')
251 initrd_hash
= '1dbb8a396e916847325284dbe2151167'
252 initrd_path_gz
= self
.fetch_asset(initrd_url
, algorithm
='md5',
253 asset_hash
=initrd_hash
)
254 initrd_path
= self
.workdir
+ "rootfs.cpio"
255 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
257 self
.vm
.set_console()
258 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
259 + 'console=ttyS0 console=tty '
260 + 'rdinit=/sbin/init noreboot')
261 self
.vm
.add_args('-kernel', kernel_path
,
262 '-initrd', initrd_path
,
263 '-append', kernel_command_line
,
266 wait_for_console_pattern(self
, 'Boot successful.')
268 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
270 exec_command_and_wait_for_pattern(self
, 'uname -a',
271 '3.19.3.mtoman.20150408')
272 exec_command_and_wait_for_pattern(self
, 'reboot',
273 'reboot: Restarting system')
274 # Wait for VM to shut down gracefully
277 def do_test_mips_malta32el_nanomips(self
, kernel_url
, kernel_hash
):
278 kernel_path_xz
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
279 kernel_path
= self
.workdir
+ "kernel"
280 with lzma
.open(kernel_path_xz
, 'rb') as f_in
:
281 with
open(kernel_path
, 'wb') as f_out
:
282 shutil
.copyfileobj(f_in
, f_out
)
284 self
.vm
.set_console()
285 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
288 self
.vm
.add_args('-no-reboot',
289 '-kernel', kernel_path
,
290 '-append', kernel_command_line
)
292 console_pattern
= 'Kernel command line: %s' % kernel_command_line
293 self
.wait_for_console_pattern(console_pattern
)
295 def test_mips_malta32el_nanomips_4k(self
):
297 :avocado: tags=arch:mipsel
298 :avocado: tags=machine:malta
299 :avocado: tags=endian:little
300 :avocado: tags=cpu:I7200
302 kernel_url
= ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
303 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
304 'generic_nano32r6el_page4k.xz')
305 kernel_hash
= '477456aafd2a0f1ddc9482727f20fe9575565dd6'
306 self
.do_test_mips_malta32el_nanomips(kernel_url
, kernel_hash
)
308 def test_mips_malta32el_nanomips_16k_up(self
):
310 :avocado: tags=arch:mipsel
311 :avocado: tags=machine:malta
312 :avocado: tags=endian:little
313 :avocado: tags=cpu:I7200
315 kernel_url
= ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
316 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
317 'generic_nano32r6el_page16k_up.xz')
318 kernel_hash
= 'e882868f944c71c816e832e2303b7874d044a7bc'
319 self
.do_test_mips_malta32el_nanomips(kernel_url
, kernel_hash
)
321 def test_mips_malta32el_nanomips_64k_dbg(self
):
323 :avocado: tags=arch:mipsel
324 :avocado: tags=machine:malta
325 :avocado: tags=endian:little
326 :avocado: tags=cpu:I7200
328 kernel_url
= ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
329 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
330 'generic_nano32r6el_page64k_dbg.xz')
331 kernel_hash
= '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
332 self
.do_test_mips_malta32el_nanomips(kernel_url
, kernel_hash
)
334 def test_aarch64_xlnx_versal_virt(self
):
336 :avocado: tags=arch:aarch64
337 :avocado: tags=machine:xlnx-versal-virt
338 :avocado: tags=device:pl011
339 :avocado: tags=device:arm_gicv3
340 :avocado: tags=accel:tcg
342 images_url
= ('http://ports.ubuntu.com/ubuntu-ports/dists/'
343 'bionic-updates/main/installer-arm64/'
344 '20101020ubuntu543.19/images/')
345 kernel_url
= images_url
+ 'netboot/ubuntu-installer/arm64/linux'
346 kernel_hash
= 'e167757620640eb26de0972f578741924abb3a82'
347 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
349 initrd_url
= images_url
+ 'netboot/ubuntu-installer/arm64/initrd.gz'
350 initrd_hash
= 'cab5cb3fcefca8408aa5aae57f24574bfce8bdb9'
351 initrd_path
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
353 self
.vm
.set_console()
354 self
.vm
.add_args('-m', '2G',
356 '-kernel', kernel_path
,
357 '-initrd', initrd_path
)
359 self
.wait_for_console_pattern('Checked W+X mappings: passed')
361 def test_arm_virt(self
):
363 :avocado: tags=arch:arm
364 :avocado: tags=machine:virt
365 :avocado: tags=accel:tcg
367 kernel_url
= ('https://archives.fedoraproject.org/pub/archive/fedora'
368 '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
370 kernel_hash
= 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
371 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
373 self
.vm
.set_console()
374 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
376 self
.vm
.add_args('-kernel', kernel_path
,
377 '-append', kernel_command_line
)
379 console_pattern
= 'Kernel command line: %s' % kernel_command_line
380 self
.wait_for_console_pattern(console_pattern
)
382 def test_arm_emcraft_sf2(self
):
384 :avocado: tags=arch:arm
385 :avocado: tags=machine:emcraft-sf2
386 :avocado: tags=endian:little
387 :avocado: tags=u-boot
388 :avocado: tags=accel:tcg
390 self
.require_netdev('user')
392 uboot_url
= ('https://raw.githubusercontent.com/'
393 'Subbaraya-Sundeep/qemu-test-binaries/'
394 'fe371d32e50ca682391e1e70ab98c2942aeffb01/u-boot')
395 uboot_hash
= 'cbb8cbab970f594bf6523b9855be209c08374ae2'
396 uboot_path
= self
.fetch_asset(uboot_url
, asset_hash
=uboot_hash
)
397 spi_url
= ('https://raw.githubusercontent.com/'
398 'Subbaraya-Sundeep/qemu-test-binaries/'
399 'fe371d32e50ca682391e1e70ab98c2942aeffb01/spi.bin')
400 spi_hash
= '65523a1835949b6f4553be96dec1b6a38fb05501'
401 spi_path
= self
.fetch_asset(spi_url
, asset_hash
=spi_hash
)
403 file_truncate(spi_path
, 16 << 20) # Spansion S25FL128SDPBHICO is 16 MiB
405 self
.vm
.set_console()
406 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
407 self
.vm
.add_args('-kernel', uboot_path
,
408 '-append', kernel_command_line
,
409 '-drive', 'file=' + spi_path
+ ',if=mtd,format=raw',
412 self
.wait_for_console_pattern('Enter \'help\' for a list')
414 exec_command_and_wait_for_pattern(self
, 'ifconfig eth0 10.0.2.15',
415 'eth0: link becomes ready')
416 exec_command_and_wait_for_pattern(self
, 'ping -c 3 10.0.2.2',
417 '3 packets transmitted, 3 packets received, 0% packet loss')
419 def do_test_arm_raspi2(self
, uart_id
):
421 :avocado: tags=accel:tcg
423 The kernel can be rebuilt using the kernel source referenced
424 and following the instructions on the on:
425 https://www.raspberrypi.org/documentation/linux/kernel/building.md
427 serial_kernel_cmdline
= {
428 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
430 deb_url
= ('http://archive.raspberrypi.org/debian/'
431 'pool/main/r/raspberrypi-firmware/'
432 'raspberrypi-kernel_1.20190215-1_armhf.deb')
433 deb_hash
= 'cd284220b32128c5084037553db3c482426f3972'
434 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
435 kernel_path
= self
.extract_from_deb(deb_path
, '/boot/kernel7.img')
436 dtb_path
= self
.extract_from_deb(deb_path
, '/boot/bcm2709-rpi-2-b.dtb')
438 self
.vm
.set_console()
439 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
440 serial_kernel_cmdline
[uart_id
] +
441 ' root=/dev/mmcblk0p2 rootwait ' +
442 'dwc_otg.fiq_fsm_enable=0')
443 self
.vm
.add_args('-kernel', kernel_path
,
445 '-append', kernel_command_line
,
446 '-device', 'usb-kbd')
448 console_pattern
= 'Kernel command line: %s' % kernel_command_line
449 self
.wait_for_console_pattern(console_pattern
)
450 console_pattern
= 'Product: QEMU USB Keyboard'
451 self
.wait_for_console_pattern(console_pattern
)
453 def test_arm_raspi2_uart0(self
):
455 :avocado: tags=arch:arm
456 :avocado: tags=machine:raspi2b
457 :avocado: tags=device:pl011
458 :avocado: tags=accel:tcg
460 self
.do_test_arm_raspi2(0)
462 def test_arm_raspi2_initrd(self
):
464 :avocado: tags=arch:arm
465 :avocado: tags=machine:raspi2b
467 deb_url
= ('http://archive.raspberrypi.org/debian/'
468 'pool/main/r/raspberrypi-firmware/'
469 'raspberrypi-kernel_1.20190215-1_armhf.deb')
470 deb_hash
= 'cd284220b32128c5084037553db3c482426f3972'
471 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
472 kernel_path
= self
.extract_from_deb(deb_path
, '/boot/kernel7.img')
473 dtb_path
= self
.extract_from_deb(deb_path
, '/boot/bcm2709-rpi-2-b.dtb')
475 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
476 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
477 'arm/rootfs-armv7a.cpio.gz')
478 initrd_hash
= '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
479 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
480 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
481 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
483 self
.vm
.set_console()
484 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
485 'earlycon=pl011,0x3f201000 console=ttyAMA0 '
486 'panic=-1 noreboot ' +
487 'dwc_otg.fiq_fsm_enable=0')
488 self
.vm
.add_args('-kernel', kernel_path
,
490 '-initrd', initrd_path
,
491 '-append', kernel_command_line
,
494 self
.wait_for_console_pattern('Boot successful.')
496 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
498 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
499 '/soc/cprman@7e101000')
500 exec_command_and_wait_for_pattern(self
, 'halt', 'reboot: System halted')
501 # Wait for VM to shut down gracefully
504 def test_arm_raspi4(self
):
506 :avocado: tags=arch:aarch64
507 :avocado: tags=machine:raspi4b
508 :avocado: tags=device:pl011
509 :avocado: tags=accel:tcg
512 The kernel can be rebuilt using the kernel source referenced
513 and following the instructions on the on:
514 https://www.raspberrypi.org/documentation/linux/kernel/building.md
517 deb_url
= ('http://archive.raspberrypi.org/debian/'
518 'pool/main/r/raspberrypi-firmware/'
519 'raspberrypi-kernel_1.20230106-1_arm64.deb')
520 deb_hash
= '08dc55696535b18a6d4fe6fa10d4c0d905cbb2ed'
521 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
522 kernel_path
= self
.extract_from_deb(deb_path
, '/boot/kernel8.img')
523 dtb_path
= self
.extract_from_deb(deb_path
, '/boot/bcm2711-rpi-4-b.dtb')
525 self
.vm
.set_console()
526 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
527 'earlycon=pl011,mmio32,0xfe201000 ' +
528 'console=ttyAMA0,115200 ' +
529 'root=/dev/mmcblk1p2 rootwait ' +
530 'dwc_otg.fiq_fsm_enable=0')
531 self
.vm
.add_args('-kernel', kernel_path
,
533 '-append', kernel_command_line
)
534 # When PCI is supported we can add a USB controller:
535 # '-device', 'qemu-xhci,bus=pcie.1,id=xhci',
536 # '-device', 'usb-kbd,bus=xhci.0',
538 console_pattern
= 'Kernel command line: %s' % kernel_command_line
539 self
.wait_for_console_pattern(console_pattern
)
540 # When USB is enabled we can look for this
541 # console_pattern = 'Product: QEMU USB Keyboard'
542 # self.wait_for_console_pattern(console_pattern)
543 console_pattern
= 'Waiting for root device'
544 self
.wait_for_console_pattern(console_pattern
)
547 def test_arm_raspi4_initrd(self
):
549 :avocado: tags=arch:aarch64
550 :avocado: tags=machine:raspi4b
551 :avocado: tags=device:pl011
552 :avocado: tags=accel:tcg
555 The kernel can be rebuilt using the kernel source referenced
556 and following the instructions on the on:
557 https://www.raspberrypi.org/documentation/linux/kernel/building.md
559 deb_url
= ('http://archive.raspberrypi.org/debian/'
560 'pool/main/r/raspberrypi-firmware/'
561 'raspberrypi-kernel_1.20230106-1_arm64.deb')
562 deb_hash
= '08dc55696535b18a6d4fe6fa10d4c0d905cbb2ed'
563 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
564 kernel_path
= self
.extract_from_deb(deb_path
, '/boot/kernel8.img')
565 dtb_path
= self
.extract_from_deb(deb_path
, '/boot/bcm2711-rpi-4-b.dtb')
567 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
568 '86b2be1384d41c8c388e63078a847f1e1c4cb1de/rootfs/'
569 'arm64/rootfs.cpio.gz')
570 initrd_hash
= 'f3d4f9fa92a49aa542f1b44d34be77bbf8ca5b9d'
571 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
572 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
573 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
575 self
.vm
.set_console()
576 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
577 'earlycon=pl011,mmio32,0xfe201000 ' +
578 'console=ttyAMA0,115200 ' +
579 'panic=-1 noreboot ' +
580 'dwc_otg.fiq_fsm_enable=0')
581 self
.vm
.add_args('-kernel', kernel_path
,
583 '-initrd', initrd_path
,
584 '-append', kernel_command_line
,
586 # When PCI is supported we can add a USB controller:
587 # '-device', 'qemu-xhci,bus=pcie.1,id=xhci',
588 # '-device', 'usb-kbd,bus=xhci.0',
590 self
.wait_for_console_pattern('Boot successful.')
592 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
594 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
596 exec_command_and_wait_for_pattern(self
, 'halt', 'reboot: System halted')
597 # TODO: Raspberry Pi4 doesn't shut down properly with recent kernels
598 # Wait for VM to shut down gracefully
601 def test_arm_exynos4210_initrd(self
):
603 :avocado: tags=arch:arm
604 :avocado: tags=machine:smdkc210
605 :avocado: tags=accel:tcg
607 deb_url
= ('https://snapshot.debian.org/archive/debian/'
608 '20190928T224601Z/pool/main/l/linux/'
609 'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
610 deb_hash
= 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
611 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
612 kernel_path
= self
.extract_from_deb(deb_path
,
613 '/boot/vmlinuz-4.19.0-6-armmp')
614 dtb_path
= '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
615 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
617 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
618 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
619 'arm/rootfs-armv5.cpio.gz')
620 initrd_hash
= '2b50f1873e113523967806f4da2afe385462ff9b'
621 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
622 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
623 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
625 self
.vm
.set_console()
626 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
627 'earlycon=exynos4210,0x13800000 earlyprintk ' +
628 'console=ttySAC0,115200n8 ' +
629 'random.trust_cpu=off cryptomgr.notests ' +
630 'cpuidle.off=1 panic=-1 noreboot')
632 self
.vm
.add_args('-kernel', kernel_path
,
634 '-initrd', initrd_path
,
635 '-append', kernel_command_line
,
639 self
.wait_for_console_pattern('Boot successful.')
640 # TODO user command, for now the uart is stuck
642 def test_arm_cubieboard_initrd(self
):
644 :avocado: tags=arch:arm
645 :avocado: tags=machine:cubieboard
646 :avocado: tags=accel:tcg
648 deb_url
= ('https://apt.armbian.com/pool/main/l/'
649 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
650 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
651 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
652 kernel_path
= self
.extract_from_deb(deb_path
,
653 '/boot/vmlinuz-6.6.16-current-sunxi')
654 dtb_path
= '/usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb'
655 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
656 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
657 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
658 'arm/rootfs-armv5.cpio.gz')
659 initrd_hash
= '2b50f1873e113523967806f4da2afe385462ff9b'
660 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
661 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
662 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
664 self
.vm
.set_console()
665 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
666 'console=ttyS0,115200 '
669 self
.vm
.add_args('-kernel', kernel_path
,
671 '-initrd', initrd_path
,
672 '-append', kernel_command_line
,
675 self
.wait_for_console_pattern('Boot successful.')
677 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
678 'Allwinner sun4i/sun5i')
679 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
680 'system-control@1c00000')
681 exec_command_and_wait_for_pattern(self
, 'reboot',
682 'reboot: Restarting system')
683 # Wait for VM to shut down gracefully
686 def test_arm_cubieboard_sata(self
):
688 :avocado: tags=arch:arm
689 :avocado: tags=machine:cubieboard
690 :avocado: tags=accel:tcg
692 deb_url
= ('https://apt.armbian.com/pool/main/l/'
693 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
694 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
695 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
696 kernel_path
= self
.extract_from_deb(deb_path
,
697 '/boot/vmlinuz-6.6.16-current-sunxi')
698 dtb_path
= '/usr/lib/linux-image-6.6.16-current-sunxi/sun4i-a10-cubieboard.dtb'
699 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
700 rootfs_url
= ('https://github.com/groeck/linux-build-test/raw/'
701 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
702 'arm/rootfs-armv5.ext2.gz')
703 rootfs_hash
= '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
704 rootfs_path_gz
= self
.fetch_asset(rootfs_url
, asset_hash
=rootfs_hash
)
705 rootfs_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
706 archive
.gzip_uncompress(rootfs_path_gz
, rootfs_path
)
708 self
.vm
.set_console()
709 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
710 'console=ttyS0,115200 '
714 self
.vm
.add_args('-kernel', kernel_path
,
716 '-drive', 'if=none,format=raw,id=disk0,file='
718 '-device', 'ide-hd,bus=ide.0,drive=disk0',
719 '-append', kernel_command_line
,
722 self
.wait_for_console_pattern('Boot successful.')
724 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
725 'Allwinner sun4i/sun5i')
726 exec_command_and_wait_for_pattern(self
, 'cat /proc/partitions',
728 exec_command_and_wait_for_pattern(self
, 'reboot',
729 'reboot: Restarting system')
730 # Wait for VM to shut down gracefully
733 @skipUnless(os
.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
734 def test_arm_cubieboard_openwrt_22_03_2(self
):
736 :avocado: tags=arch:arm
737 :avocado: tags=machine:cubieboard
738 :avocado: tags=device:sd
741 # This test download a 7.5 MiB compressed image and expand it
743 image_url
= ('https://downloads.openwrt.org/releases/22.03.2/targets/'
744 'sunxi/cortexa8/openwrt-22.03.2-sunxi-cortexa8-'
745 'cubietech_a10-cubieboard-ext4-sdcard.img.gz')
746 image_hash
= ('94b5ecbfbc0b3b56276e5146b899eafa'
747 '2ac5dc2d08733d6705af9f144f39f554')
748 image_path_gz
= self
.fetch_asset(image_url
, asset_hash
=image_hash
,
750 image_path
= archive
.extract(image_path_gz
, self
.workdir
)
751 image_pow2ceil_expand(image_path
)
753 self
.vm
.set_console()
754 self
.vm
.add_args('-drive', 'file=' + image_path
+ ',if=sd,format=raw',
759 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
763 self
.wait_for_console_pattern('U-Boot SPL')
765 interrupt_interactive_console_until_pattern(
766 self
, 'Hit any key to stop autoboot:', '=>')
767 exec_command_and_wait_for_pattern(self
, "setenv extraargs '" +
768 kernel_command_line
+ "'", '=>')
769 exec_command_and_wait_for_pattern(self
, 'boot', 'Starting kernel ...');
771 self
.wait_for_console_pattern(
772 'Please press Enter to activate this console.')
774 exec_command_and_wait_for_pattern(self
, ' ', 'root@')
776 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
777 'Allwinner sun4i/sun5i')
778 exec_command_and_wait_for_pattern(self
, 'reboot',
779 'reboot: Restarting system')
780 # Wait for VM to shut down gracefully
783 @skipUnless(os
.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
784 def test_arm_quanta_gsj(self
):
786 :avocado: tags=arch:arm
787 :avocado: tags=machine:quanta-gsj
788 :avocado: tags=accel:tcg
790 # 25 MiB compressed, 32 MiB uncompressed.
792 'https://github.com/hskinnemoen/openbmc/releases/download/'
793 '20200711-gsj-qemu-0/obmc-phosphor-image-gsj.static.mtd.gz')
794 image_hash
= '14895e634923345cb5c8776037ff7876df96f6b1'
795 image_path_gz
= self
.fetch_asset(image_url
, asset_hash
=image_hash
)
796 image_name
= 'obmc.mtd'
797 image_path
= os
.path
.join(self
.workdir
, image_name
)
798 archive
.gzip_uncompress(image_path_gz
, image_path
)
800 self
.vm
.set_console()
801 drive_args
= 'file=' + image_path
+ ',if=mtd,bus=0,unit=0'
802 self
.vm
.add_args('-drive', drive_args
)
805 # Disable drivers and services that stall for a long time during boot,
806 # to avoid running past the 90-second timeout. These may be removed
807 # as the corresponding device support is added.
808 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ (
809 'console=${console} '
811 'initcall_blacklist=npcm_i2c_bus_driver_init '
812 'systemd.mask=systemd-random-seed.service '
813 'systemd.mask=dropbearkey.service '
816 self
.wait_for_console_pattern('> BootBlock by Nuvoton')
817 self
.wait_for_console_pattern('>Device: Poleg BMC NPCM730')
818 self
.wait_for_console_pattern('>Skip DDR init.')
819 self
.wait_for_console_pattern('U-Boot ')
820 interrupt_interactive_console_until_pattern(
821 self
, 'Hit any key to stop autoboot:', 'U-Boot>')
822 exec_command_and_wait_for_pattern(
823 self
, "setenv bootargs ${bootargs} " + kernel_command_line
,
825 exec_command_and_wait_for_pattern(
826 self
, 'run romboot', 'Booting Kernel from flash')
827 self
.wait_for_console_pattern('Booting Linux on physical CPU 0x0')
828 self
.wait_for_console_pattern('CPU1: thread -1, cpu 1, socket 0')
829 self
.wait_for_console_pattern('OpenBMC Project Reference Distro')
830 self
.wait_for_console_pattern('gsj login:')
832 def test_arm_quanta_gsj_initrd(self
):
834 :avocado: tags=arch:arm
835 :avocado: tags=machine:quanta-gsj
836 :avocado: tags=accel:tcg
839 'https://github.com/hskinnemoen/openbmc/releases/download/'
840 '20200711-gsj-qemu-0/obmc-phosphor-initramfs-gsj.cpio.xz')
841 initrd_hash
= '98fefe5d7e56727b1eb17d5c00311b1b5c945300'
842 initrd_path
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
844 'https://github.com/hskinnemoen/openbmc/releases/download/'
845 '20200711-gsj-qemu-0/uImage-gsj.bin')
846 kernel_hash
= 'fa67b2f141d56d39b3c54305c0e8a899c99eb2c7'
847 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
849 'https://github.com/hskinnemoen/openbmc/releases/download/'
850 '20200711-gsj-qemu-0/nuvoton-npcm730-gsj.dtb')
851 dtb_hash
= '18315f7006d7b688d8312d5c727eecd819aa36a4'
852 dtb_path
= self
.fetch_asset(dtb_url
, asset_hash
=dtb_hash
)
854 self
.vm
.set_console()
855 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
856 'console=ttyS0,115200n8 '
857 'earlycon=uart8250,mmio32,0xf0001000')
858 self
.vm
.add_args('-kernel', kernel_path
,
859 '-initrd', initrd_path
,
861 '-append', kernel_command_line
)
864 self
.wait_for_console_pattern('Booting Linux on physical CPU 0x0')
865 self
.wait_for_console_pattern('CPU1: thread -1, cpu 1, socket 0')
866 self
.wait_for_console_pattern(
867 'Give root password for system maintenance')
869 def test_arm_bpim2u(self
):
871 :avocado: tags=arch:arm
872 :avocado: tags=machine:bpim2u
873 :avocado: tags=accel:tcg
875 deb_url
= ('https://apt.armbian.com/pool/main/l/'
876 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
877 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
878 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
879 kernel_path
= self
.extract_from_deb(deb_path
,
880 '/boot/vmlinuz-6.6.16-current-sunxi')
881 dtb_path
= ('/usr/lib/linux-image-6.6.16-current-sunxi/'
882 'sun8i-r40-bananapi-m2-ultra.dtb')
883 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
885 self
.vm
.set_console()
886 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
887 'console=ttyS0,115200n8 '
888 'earlycon=uart,mmio32,0x1c28000')
889 self
.vm
.add_args('-kernel', kernel_path
,
891 '-append', kernel_command_line
)
893 console_pattern
= 'Kernel command line: %s' % kernel_command_line
894 self
.wait_for_console_pattern(console_pattern
)
896 def test_arm_bpim2u_initrd(self
):
898 :avocado: tags=arch:arm
899 :avocado: tags=accel:tcg
900 :avocado: tags=machine:bpim2u
902 deb_url
= ('https://apt.armbian.com/pool/main/l/'
903 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
904 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
905 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
906 kernel_path
= self
.extract_from_deb(deb_path
,
907 '/boot/vmlinuz-6.6.16-current-sunxi')
908 dtb_path
= ('/usr/lib/linux-image-6.6.16-current-sunxi/'
909 'sun8i-r40-bananapi-m2-ultra.dtb')
910 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
911 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
912 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
913 'arm/rootfs-armv7a.cpio.gz')
914 initrd_hash
= '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
915 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
916 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
917 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
919 self
.vm
.set_console()
920 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
921 'console=ttyS0,115200 '
923 self
.vm
.add_args('-kernel', kernel_path
,
925 '-initrd', initrd_path
,
926 '-append', kernel_command_line
,
929 self
.wait_for_console_pattern('Boot successful.')
931 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
932 'Allwinner sun8i Family')
933 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
934 'system-control@1c00000')
935 exec_command_and_wait_for_pattern(self
, 'reboot',
936 'reboot: Restarting system')
937 # Wait for VM to shut down gracefully
940 def test_arm_bpim2u_gmac(self
):
942 :avocado: tags=arch:arm
943 :avocado: tags=accel:tcg
944 :avocado: tags=machine:bpim2u
945 :avocado: tags=device:sd
947 self
.require_netdev('user')
949 deb_url
= ('https://apt.armbian.com/pool/main/l/'
950 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
951 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
952 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
953 kernel_path
= self
.extract_from_deb(deb_path
,
954 '/boot/vmlinuz-6.6.16-current-sunxi')
955 dtb_path
= ('/usr/lib/linux-image-6.6.16-current-sunxi/'
956 'sun8i-r40-bananapi-m2-ultra.dtb')
957 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
958 rootfs_url
= ('http://storage.kernelci.org/images/rootfs/buildroot/'
959 'buildroot-baseline/20221116.0/armel/rootfs.ext2.xz')
960 rootfs_hash
= 'fae32f337c7b87547b10f42599acf109da8b6d9a'
961 rootfs_path_xz
= self
.fetch_asset(rootfs_url
, asset_hash
=rootfs_hash
)
962 rootfs_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
963 archive
.lzma_uncompress(rootfs_path_xz
, rootfs_path
)
964 image_pow2ceil_expand(rootfs_path
)
966 self
.vm
.set_console()
967 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
968 'console=ttyS0,115200 '
969 'root=b300 rootwait rw '
971 self
.vm
.add_args('-kernel', kernel_path
,
973 '-drive', 'file=' + rootfs_path
+ ',if=sd,format=raw',
974 '-net', 'nic,model=gmac,netdev=host_gmac',
975 '-netdev', 'user,id=host_gmac',
976 '-append', kernel_command_line
,
979 shell_ready
= "/bin/sh: can't access tty; job control turned off"
980 self
.wait_for_console_pattern(shell_ready
)
982 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
983 'Allwinner sun8i Family')
984 exec_command_and_wait_for_pattern(self
, 'cat /proc/partitions',
986 exec_command_and_wait_for_pattern(self
, 'ifconfig eth0 up',
988 exec_command_and_wait_for_pattern(self
, 'udhcpc eth0',
989 'udhcpc: lease of 10.0.2.15 obtained')
990 exec_command_and_wait_for_pattern(self
, 'ping -c 3 10.0.2.2',
991 '3 packets transmitted, 3 packets received, 0% packet loss')
992 exec_command_and_wait_for_pattern(self
, 'reboot',
993 'reboot: Restarting system')
994 # Wait for VM to shut down gracefully
997 @skipUnless(os
.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
998 def test_arm_bpim2u_openwrt_22_03_3(self
):
1000 :avocado: tags=arch:arm
1001 :avocado: tags=machine:bpim2u
1002 :avocado: tags=device:sd
1005 # This test download a 8.9 MiB compressed image and expand it
1007 image_url
= ('https://downloads.openwrt.org/releases/22.03.3/targets/'
1008 'sunxi/cortexa7/openwrt-22.03.3-sunxi-cortexa7-'
1009 'sinovoip_bananapi-m2-ultra-ext4-sdcard.img.gz')
1010 image_hash
= ('5b41b4e11423e562c6011640f9a7cd3b'
1011 'dd0a3d42b83430f7caa70a432e6cd82c')
1012 image_path_gz
= self
.fetch_asset(image_url
, asset_hash
=image_hash
,
1014 image_path
= archive
.extract(image_path_gz
, self
.workdir
)
1015 image_pow2ceil_expand(image_path
)
1017 self
.vm
.set_console()
1018 self
.vm
.add_args('-drive', 'file=' + image_path
+ ',if=sd,format=raw',
1023 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1027 self
.wait_for_console_pattern('U-Boot SPL')
1029 interrupt_interactive_console_until_pattern(
1030 self
, 'Hit any key to stop autoboot:', '=>')
1031 exec_command_and_wait_for_pattern(self
, "setenv extraargs '" +
1032 kernel_command_line
+ "'", '=>')
1033 exec_command_and_wait_for_pattern(self
, 'boot', 'Starting kernel ...');
1035 self
.wait_for_console_pattern(
1036 'Please press Enter to activate this console.')
1038 exec_command_and_wait_for_pattern(self
, ' ', 'root@')
1040 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
1041 'Allwinner sun8i Family')
1042 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
1043 'system-control@1c00000')
1045 def test_arm_orangepi(self
):
1047 :avocado: tags=arch:arm
1048 :avocado: tags=machine:orangepi-pc
1049 :avocado: tags=accel:tcg
1051 deb_url
= ('https://apt.armbian.com/pool/main/l/'
1052 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
1053 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
1054 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
1055 kernel_path
= self
.extract_from_deb(deb_path
,
1056 '/boot/vmlinuz-6.6.16-current-sunxi')
1057 dtb_path
= '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
1058 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
1060 self
.vm
.set_console()
1061 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1062 'console=ttyS0,115200n8 '
1063 'earlycon=uart,mmio32,0x1c28000')
1064 self
.vm
.add_args('-kernel', kernel_path
,
1066 '-append', kernel_command_line
)
1068 console_pattern
= 'Kernel command line: %s' % kernel_command_line
1069 self
.wait_for_console_pattern(console_pattern
)
1071 def test_arm_orangepi_initrd(self
):
1073 :avocado: tags=arch:arm
1074 :avocado: tags=accel:tcg
1075 :avocado: tags=machine:orangepi-pc
1077 deb_url
= ('https://apt.armbian.com/pool/main/l/'
1078 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
1079 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
1080 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
1081 kernel_path
= self
.extract_from_deb(deb_path
,
1082 '/boot/vmlinuz-6.6.16-current-sunxi')
1083 dtb_path
= '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
1084 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
1085 initrd_url
= ('https://github.com/groeck/linux-build-test/raw/'
1086 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
1087 'arm/rootfs-armv7a.cpio.gz')
1088 initrd_hash
= '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
1089 initrd_path_gz
= self
.fetch_asset(initrd_url
, asset_hash
=initrd_hash
)
1090 initrd_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
1091 archive
.gzip_uncompress(initrd_path_gz
, initrd_path
)
1093 self
.vm
.set_console()
1094 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1095 'console=ttyS0,115200 '
1096 'panic=-1 noreboot')
1097 self
.vm
.add_args('-kernel', kernel_path
,
1099 '-initrd', initrd_path
,
1100 '-append', kernel_command_line
,
1103 self
.wait_for_console_pattern('Boot successful.')
1105 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
1106 'Allwinner sun8i Family')
1107 exec_command_and_wait_for_pattern(self
, 'cat /proc/iomem',
1108 'system-control@1c00000')
1109 exec_command_and_wait_for_pattern(self
, 'reboot',
1110 'reboot: Restarting system')
1111 # Wait for VM to shut down gracefully
1114 def test_arm_orangepi_sd(self
):
1116 :avocado: tags=arch:arm
1117 :avocado: tags=accel:tcg
1118 :avocado: tags=machine:orangepi-pc
1119 :avocado: tags=device:sd
1121 self
.require_netdev('user')
1123 deb_url
= ('https://apt.armbian.com/pool/main/l/'
1124 'linux-6.6.16/linux-image-current-sunxi_24.2.1_armhf__6.6.16-Seb3e-D6b4a-P2359-Ce96bHfe66-HK01ba-V014b-B067e-R448a.deb')
1125 deb_hash
= 'f7c3c8c5432f765445dc6e7eab02f3bbe668256b'
1126 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
1127 kernel_path
= self
.extract_from_deb(deb_path
,
1128 '/boot/vmlinuz-6.6.16-current-sunxi')
1129 dtb_path
= '/usr/lib/linux-image-6.6.16-current-sunxi/sun8i-h3-orangepi-pc.dtb'
1130 dtb_path
= self
.extract_from_deb(deb_path
, dtb_path
)
1131 rootfs_url
= ('http://storage.kernelci.org/images/rootfs/buildroot/'
1132 'buildroot-baseline/20221116.0/armel/rootfs.ext2.xz')
1133 rootfs_hash
= 'fae32f337c7b87547b10f42599acf109da8b6d9a'
1134 rootfs_path_xz
= self
.fetch_asset(rootfs_url
, asset_hash
=rootfs_hash
)
1135 rootfs_path
= os
.path
.join(self
.workdir
, 'rootfs.cpio')
1136 archive
.lzma_uncompress(rootfs_path_xz
, rootfs_path
)
1137 image_pow2ceil_expand(rootfs_path
)
1139 self
.vm
.set_console()
1140 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1141 'console=ttyS0,115200 '
1142 'root=/dev/mmcblk0 rootwait rw '
1143 'panic=-1 noreboot')
1144 self
.vm
.add_args('-kernel', kernel_path
,
1146 '-drive', 'file=' + rootfs_path
+ ',if=sd,format=raw',
1147 '-append', kernel_command_line
,
1150 shell_ready
= "/bin/sh: can't access tty; job control turned off"
1151 self
.wait_for_console_pattern(shell_ready
)
1153 exec_command_and_wait_for_pattern(self
, 'cat /proc/cpuinfo',
1154 'Allwinner sun8i Family')
1155 exec_command_and_wait_for_pattern(self
, 'cat /proc/partitions',
1157 exec_command_and_wait_for_pattern(self
, 'ifconfig eth0 up',
1159 exec_command_and_wait_for_pattern(self
, 'udhcpc eth0',
1160 'udhcpc: lease of 10.0.2.15 obtained')
1161 exec_command_and_wait_for_pattern(self
, 'ping -c 3 10.0.2.2',
1162 '3 packets transmitted, 3 packets received, 0% packet loss')
1163 exec_command_and_wait_for_pattern(self
, 'reboot',
1164 'reboot: Restarting system')
1165 # Wait for VM to shut down gracefully
1168 @skipUnless(os
.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
1169 def test_arm_orangepi_bionic_20_08(self
):
1171 :avocado: tags=arch:arm
1172 :avocado: tags=machine:orangepi-pc
1173 :avocado: tags=device:sd
1176 # This test download a 275 MiB compressed image and expand it
1177 # to 1036 MiB, but the underlying filesystem is 1552 MiB...
1178 # As we expand it to 2 GiB we are safe.
1180 image_url
= ('https://archive.armbian.com/orangepipc/archive/'
1181 'Armbian_20.08.1_Orangepipc_bionic_current_5.8.5.img.xz')
1182 image_hash
= ('b4d6775f5673486329e45a0586bf06b6'
1183 'dbe792199fd182ac6b9c7bb6c7d3e6dd')
1184 image_path_xz
= self
.fetch_asset(image_url
, asset_hash
=image_hash
,
1186 image_path
= archive
.extract(image_path_xz
, self
.workdir
)
1187 image_pow2ceil_expand(image_path
)
1189 self
.vm
.set_console()
1190 self
.vm
.add_args('-drive', 'file=' + image_path
+ ',if=sd,format=raw',
1195 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1196 'console=ttyS0,115200 '
1199 'systemd.default_timeout_start_sec=9000 '
1200 'systemd.mask=armbian-zram-config.service '
1201 'systemd.mask=armbian-ramlog.service')
1203 self
.wait_for_console_pattern('U-Boot SPL')
1204 self
.wait_for_console_pattern('Autoboot in ')
1205 exec_command_and_wait_for_pattern(self
, ' ', '=>')
1206 exec_command_and_wait_for_pattern(self
, "setenv extraargs '" +
1207 kernel_command_line
+ "'", '=>')
1208 exec_command_and_wait_for_pattern(self
, 'boot', 'Starting kernel ...');
1210 self
.wait_for_console_pattern('systemd[1]: Set hostname ' +
1212 self
.wait_for_console_pattern('Starting Load Kernel Modules...')
1214 @skipUnless(os
.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
1215 def test_arm_orangepi_uboot_netbsd9(self
):
1217 :avocado: tags=arch:arm
1218 :avocado: tags=machine:orangepi-pc
1219 :avocado: tags=device:sd
1220 :avocado: tags=os:netbsd
1222 # This test download a 304MB compressed image and expand it to 2GB
1223 deb_url
= ('http://snapshot.debian.org/archive/debian/'
1224 '20200108T145233Z/pool/main/u/u-boot/'
1225 'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
1226 deb_hash
= 'f67f404a80753ca3d1258f13e38f2b060e13db99'
1227 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
1228 # We use the common OrangePi PC 'plus' build of U-Boot for our secondary
1229 # program loader (SPL). We will then set the path to the more specific
1230 # OrangePi "PC" device tree blob with 'setenv fdtfile' in U-Boot prompt,
1231 # before to boot NetBSD.
1232 uboot_path
= '/usr/lib/u-boot/orangepi_plus/u-boot-sunxi-with-spl.bin'
1233 uboot_path
= self
.extract_from_deb(deb_path
, uboot_path
)
1234 image_url
= ('https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0/'
1235 'evbarm-earmv7hf/binary/gzimg/armv7.img.gz')
1236 image_hash
= '2babb29d36d8360adcb39c09e31060945259917a'
1237 image_path_gz
= self
.fetch_asset(image_url
, asset_hash
=image_hash
)
1238 image_path
= os
.path
.join(self
.workdir
, 'armv7.img')
1239 archive
.gzip_uncompress(image_path_gz
, image_path
)
1240 image_pow2ceil_expand(image_path
)
1241 image_drive_args
= 'if=sd,format=raw,snapshot=on,file=' + image_path
1243 # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
1244 with
open(uboot_path
, 'rb') as f_in
:
1245 with
open(image_path
, 'r+b') as f_out
:
1246 f_out
.seek(8 * 1024)
1247 shutil
.copyfileobj(f_in
, f_out
)
1249 self
.vm
.set_console()
1250 self
.vm
.add_args('-nic', 'user',
1251 '-drive', image_drive_args
,
1252 '-global', 'allwinner-rtc.base-year=2000',
1255 wait_for_console_pattern(self
, 'U-Boot 2020.01+dfsg-1')
1256 interrupt_interactive_console_until_pattern(self
,
1257 'Hit any key to stop autoboot:',
1258 'switch to partitions #0, OK')
1260 exec_command_and_wait_for_pattern(self
, '', '=>')
1261 cmd
= 'setenv bootargs root=ld0a'
1262 exec_command_and_wait_for_pattern(self
, cmd
, '=>')
1263 cmd
= 'setenv kernel netbsd-GENERIC.ub'
1264 exec_command_and_wait_for_pattern(self
, cmd
, '=>')
1265 cmd
= 'setenv fdtfile dtb/sun8i-h3-orangepi-pc.dtb'
1266 exec_command_and_wait_for_pattern(self
, cmd
, '=>')
1267 cmd
= ("setenv bootcmd 'fatload mmc 0:1 ${kernel_addr_r} ${kernel}; "
1268 "fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}; "
1269 "fdt addr ${fdt_addr_r}; "
1270 "bootm ${kernel_addr_r} - ${fdt_addr_r}'")
1271 exec_command_and_wait_for_pattern(self
, cmd
, '=>')
1273 exec_command_and_wait_for_pattern(self
, 'boot',
1274 'Booting kernel from Legacy Image')
1275 wait_for_console_pattern(self
, 'Starting kernel ...')
1276 wait_for_console_pattern(self
, 'NetBSD 9.0 (GENERIC)')
1277 # Wait for user-space
1278 wait_for_console_pattern(self
, 'Starting root file system check')
1280 def test_aarch64_raspi3_atf(self
):
1282 :avocado: tags=accel:tcg
1283 :avocado: tags=arch:aarch64
1284 :avocado: tags=machine:raspi3b
1285 :avocado: tags=cpu:cortex-a53
1286 :avocado: tags=device:pl011
1289 zip_url
= ('https://github.com/pbatard/RPi3/releases/download/'
1290 'v1.15/RPi3_UEFI_Firmware_v1.15.zip')
1291 zip_hash
= '74b3bd0de92683cadb14e008a7575e1d0c3cafb9'
1292 zip_path
= self
.fetch_asset(zip_url
, asset_hash
=zip_hash
)
1294 archive
.extract(zip_path
, self
.workdir
)
1295 efi_fd
= os
.path
.join(self
.workdir
, 'RPI_EFI.fd')
1297 self
.vm
.set_console(console_index
=1)
1298 self
.vm
.add_args('-nodefaults',
1299 '-device', 'loader,file=%s,force-raw=true' % efi_fd
)
1301 self
.wait_for_console_pattern('version UEFI Firmware v1.15')
1303 def test_s390x_s390_ccw_virtio(self
):
1305 :avocado: tags=arch:s390x
1306 :avocado: tags=machine:s390-ccw-virtio
1308 kernel_url
= ('https://archives.fedoraproject.org/pub/archive'
1309 '/fedora-secondary/releases/29/Everything/s390x/os/images'
1311 kernel_hash
= 'e8e8439103ef8053418ef062644ffd46a7919313'
1312 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
1314 self
.vm
.set_console()
1315 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=sclp0'
1316 self
.vm
.add_args('-nodefaults',
1317 '-kernel', kernel_path
,
1318 '-append', kernel_command_line
)
1320 console_pattern
= 'Kernel command line: %s' % kernel_command_line
1321 self
.wait_for_console_pattern(console_pattern
)
1323 def test_alpha_clipper(self
):
1325 :avocado: tags=arch:alpha
1326 :avocado: tags=machine:clipper
1328 kernel_url
= ('http://archive.debian.org/debian/dists/lenny/main/'
1329 'installer-alpha/20090123lenny10/images/cdrom/vmlinuz')
1330 kernel_hash
= '3a943149335529e2ed3e74d0d787b85fb5671ba3'
1331 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
)
1333 uncompressed_kernel
= archive
.uncompress(kernel_path
, self
.workdir
)
1335 self
.vm
.set_console()
1336 kernel_command_line
= self
.KERNEL_COMMON_COMMAND_LINE
+ 'console=ttyS0'
1337 self
.vm
.add_args('-nodefaults',
1338 '-kernel', uncompressed_kernel
,
1339 '-append', kernel_command_line
)
1341 console_pattern
= 'Kernel command line: %s' % kernel_command_line
1342 self
.wait_for_console_pattern(console_pattern
)
1344 def test_m68k_q800(self
):
1346 :avocado: tags=arch:m68k
1347 :avocado: tags=machine:q800
1349 deb_url
= ('https://snapshot.debian.org/archive/debian-ports'
1350 '/20191021T083923Z/pool-m68k/main'
1351 '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
1352 deb_hash
= '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
1353 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
)
1354 kernel_path
= self
.extract_from_deb(deb_path
,
1355 '/boot/vmlinux-5.3.0-1-m68k')
1357 self
.vm
.set_console()
1358 kernel_command_line
= (self
.KERNEL_COMMON_COMMAND_LINE
+
1359 'console=ttyS0 vga=off')
1360 self
.vm
.add_args('-kernel', kernel_path
,
1361 '-append', kernel_command_line
)
1363 console_pattern
= 'Kernel command line: %s' % kernel_command_line
1364 self
.wait_for_console_pattern(console_pattern
)
1365 console_pattern
= 'No filesystem could mount root'
1366 self
.wait_for_console_pattern(console_pattern
)
1368 def do_test_advcal_2018(self
, day
, tar_hash
, kernel_name
, console
=0):
1369 tar_url
= ('https://qemu-advcal.gitlab.io'
1370 '/qac-best-of-multiarch/download/day' + day
+ '.tar.xz')
1371 file_path
= self
.fetch_asset(tar_url
, asset_hash
=tar_hash
)
1372 archive
.extract(file_path
, self
.workdir
)
1373 self
.vm
.set_console(console_index
=console
)
1374 self
.vm
.add_args('-kernel',
1375 self
.workdir
+ '/day' + day
+ '/' + kernel_name
)
1377 self
.wait_for_console_pattern('QEMU advent calendar')
1379 def test_arm_vexpressa9(self
):
1381 :avocado: tags=arch:arm
1382 :avocado: tags=machine:vexpress-a9
1384 tar_hash
= '32b7677ce8b6f1471fb0059865f451169934245b'
1385 self
.vm
.add_args('-dtb', self
.workdir
+ '/day16/vexpress-v2p-ca9.dtb')
1386 self
.do_test_advcal_2018('16', tar_hash
, 'winter.zImage')
1388 def test_arm_ast2600_debian(self
):
1390 :avocado: tags=arch:arm
1391 :avocado: tags=machine:rainier-bmc
1393 deb_url
= ('http://snapshot.debian.org/archive/debian/'
1395 'pool/main/l/linux/'
1396 'linux-image-5.17.0-2-armmp_5.17.6-1%2Bb1_armhf.deb')
1397 deb_hash
= '8acb2b4439faedc2f3ed4bdb2847ad4f6e0491f73debaeb7f660c8abe4dcdc0e'
1398 deb_path
= self
.fetch_asset(deb_url
, asset_hash
=deb_hash
,
1400 kernel_path
= self
.extract_from_deb(deb_path
, '/boot/vmlinuz-5.17.0-2-armmp')
1401 dtb_path
= self
.extract_from_deb(deb_path
,
1402 '/usr/lib/linux-image-5.17.0-2-armmp/aspeed-bmc-ibm-rainier.dtb')
1404 self
.vm
.set_console()
1405 self
.vm
.add_args('-kernel', kernel_path
,
1409 self
.wait_for_console_pattern("Booting Linux on physical CPU 0xf00")
1410 self
.wait_for_console_pattern("SMP: Total of 2 processors activated")
1411 self
.wait_for_console_pattern("No filesystem could mount root")
1413 def test_m68k_mcf5208evb(self
):
1415 :avocado: tags=arch:m68k
1416 :avocado: tags=machine:mcf5208evb
1418 tar_hash
= 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
1419 self
.do_test_advcal_2018('07', tar_hash
, 'sanity-clause.elf')
1421 def test_or1k_sim(self
):
1423 :avocado: tags=arch:or1k
1424 :avocado: tags=machine:or1k-sim
1426 tar_hash
= '20334cdaf386108c530ff0badaecc955693027dd'
1427 self
.do_test_advcal_2018('20', tar_hash
, 'vmlinux')
1429 def test_ppc64_e500(self
):
1431 :avocado: tags=arch:ppc64
1432 :avocado: tags=machine:ppce500
1433 :avocado: tags=cpu:e5500
1434 :avocado: tags=accel:tcg
1436 self
.require_accelerator("tcg")
1437 tar_hash
= '6951d86d644b302898da2fd701739c9406527fe1'
1438 self
.do_test_advcal_2018('19', tar_hash
, 'uImage')
1440 def do_test_ppc64_powernv(self
, proc
):
1441 self
.require_accelerator("tcg")
1442 images_url
= ('https://github.com/open-power/op-build/releases/download/v2.7/')
1444 kernel_url
= images_url
+ 'zImage.epapr'
1445 kernel_hash
= '0ab237df661727e5392cee97460e8674057a883c5f74381a128fa772588d45cd'
1446 kernel_path
= self
.fetch_asset(kernel_url
, asset_hash
=kernel_hash
,
1448 self
.vm
.set_console()
1449 self
.vm
.add_args('-kernel', kernel_path
,
1450 '-append', 'console=tty0 console=hvc0',
1451 '-device', 'pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0',
1452 '-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234',
1453 '-device', 'e1000e,bus=bridge1,addr=0x3',
1454 '-device', 'nec-usb-xhci,bus=bridge1,addr=0x2')
1457 self
.wait_for_console_pattern("CPU: " + proc
+ " generation processor")
1458 self
.wait_for_console_pattern("zImage starting: loaded")
1459 self
.wait_for_console_pattern("Run /init as init process")
1460 # Device detection output driven by udev probing is sometimes cut off
1461 # from console output, suspect S14silence-console init script.
1463 def test_ppc_powernv8(self
):
1465 :avocado: tags=arch:ppc64
1466 :avocado: tags=machine:powernv8
1467 :avocado: tags=accel:tcg
1469 self
.do_test_ppc64_powernv('P8')
1471 def test_ppc_powernv9(self
):
1473 :avocado: tags=arch:ppc64
1474 :avocado: tags=machine:powernv9
1475 :avocado: tags=accel:tcg
1477 self
.do_test_ppc64_powernv('P9')
1479 def test_ppc_powernv10(self
):
1481 :avocado: tags=arch:ppc64
1482 :avocado: tags=machine:powernv10
1483 :avocado: tags=accel:tcg
1485 self
.do_test_ppc64_powernv('P10')
1487 def test_ppc_g3beige(self
):
1489 :avocado: tags=arch:ppc
1490 :avocado: tags=machine:g3beige
1491 :avocado: tags=accel:tcg
1493 # TODO: g3beige works with kvm_pr but we don't have a
1494 # reliable way ATM (e.g. looking at /proc/modules) to detect
1495 # whether we're running kvm_hv or kvm_pr. For now let's
1496 # disable this test if we don't have TCG support.
1497 self
.require_accelerator("tcg")
1498 tar_hash
= 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
1499 self
.vm
.add_args('-M', 'graphics=off')
1500 self
.do_test_advcal_2018('15', tar_hash
, 'invaders.elf')
1502 def test_ppc_mac99(self
):
1504 :avocado: tags=arch:ppc
1505 :avocado: tags=machine:mac99
1506 :avocado: tags=accel:tcg
1508 # TODO: mac99 works with kvm_pr but we don't have a
1509 # reliable way ATM (e.g. looking at /proc/modules) to detect
1510 # whether we're running kvm_hv or kvm_pr. For now let's
1511 # disable this test if we don't have TCG support.
1512 self
.require_accelerator("tcg")
1513 tar_hash
= 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
1514 self
.vm
.add_args('-M', 'graphics=off')
1515 self
.do_test_advcal_2018('15', tar_hash
, 'invaders.elf')
1517 # This test has a 6-10% failure rate on various hosts that look
1518 # like issues with a buggy kernel. As a result we don't want it
1519 # gating releases on Gitlab.
1520 @skipUnless(os
.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
1522 def test_sh4_r2d(self
):
1524 :avocado: tags=arch:sh4
1525 :avocado: tags=machine:r2d
1526 :avocado: tags=flaky
1528 tar_hash
= 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
1529 self
.vm
.add_args('-append', 'console=ttySC1')
1530 self
.do_test_advcal_2018('09', tar_hash
, 'zImage', console
=1)
1532 def test_sparc_ss20(self
):
1534 :avocado: tags=arch:sparc
1535 :avocado: tags=machine:SS-20
1537 tar_hash
= 'b18550d5d61c7615d989a06edace051017726a9f'
1538 self
.do_test_advcal_2018('11', tar_hash
, 'zImage.elf')
1540 def test_xtensa_lx60(self
):
1542 :avocado: tags=arch:xtensa
1543 :avocado: tags=machine:lx60
1544 :avocado: tags=cpu:dc233c
1546 tar_hash
= '49e88d9933742f0164b60839886c9739cb7a0d34'
1547 self
.do_test_advcal_2018('02', tar_hash
, 'santas-sleigh-ride.elf')