failover: Remove primary_dev member
[qemu/ar7.git] / tests / acceptance / boot_linux_console.py
blobcc6ec0f8c1588fd0c017e483f528e56d24789fba
1 # Functional test that boots a Linux kernel and checks the console
3 # Copyright (c) 2018 Red Hat, Inc.
5 # Author:
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.
11 import os
12 import lzma
13 import gzip
14 import shutil
16 from avocado import skip
17 from avocado import skipUnless
18 from avocado_qemu import Test
19 from avocado_qemu import exec_command_and_wait_for_pattern
20 from avocado_qemu import interrupt_interactive_console_until_pattern
21 from avocado_qemu import wait_for_console_pattern
22 from avocado.utils import process
23 from avocado.utils import archive
24 from avocado.utils.path import find_command, CmdNotFoundError
26 P7ZIP_AVAILABLE = True
27 try:
28 find_command('7z')
29 except CmdNotFoundError:
30 P7ZIP_AVAILABLE = False
32 """
33 Round up to next power of 2
34 """
35 def pow2ceil(x):
36 return 1 if x == 0 else 2**(x - 1).bit_length()
38 """
39 Expand file size to next power of 2
40 """
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(Test):
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',
54 vm=vm)
56 def extract_from_deb(self, deb, path):
57 """
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
63 """
64 cwd = os.getcwd()
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)
69 os.chdir(cwd)
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):
78 """
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
86 """
87 cwd = os.getcwd()
88 os.chdir(self.workdir)
89 process.run("rpm2cpio %s | cpio -id %s" % (rpm, path), shell=True)
90 os.chdir(cwd)
91 return os.path.normpath(os.path.join(self.workdir, path))
93 class BootLinuxConsole(LinuxKernelTest):
94 """
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
97 """
98 timeout = 90
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'
107 '/vmlinuz')
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)
115 self.vm.launch()
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)
137 self.vm.launch()
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
144 the Debian package.
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)
169 self.vm.launch()
170 console_pattern = 'Kernel command line: %s' % kernel_command_line
171 self.wait_for_console_pattern(console_pattern)
173 def test_mips_malta_cpio(self):
175 :avocado: tags=arch:mips
176 :avocado: tags=machine:malta
177 :avocado: tags=endian:big
179 deb_url = ('http://snapshot.debian.org/archive/debian/'
180 '20160601T041800Z/pool/main/l/linux/'
181 'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb')
182 deb_hash = 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8'
183 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
184 kernel_path = self.extract_from_deb(deb_path,
185 '/boot/vmlinux-4.5.0-2-4kc-malta')
186 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
187 '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
188 'mips/rootfs.cpio.gz')
189 initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99'
190 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
191 initrd_path = self.workdir + "rootfs.cpio"
192 archive.gzip_uncompress(initrd_path_gz, initrd_path)
194 self.vm.set_console()
195 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
196 + 'console=ttyS0 console=tty '
197 + 'rdinit=/sbin/init noreboot')
198 self.vm.add_args('-kernel', kernel_path,
199 '-initrd', initrd_path,
200 '-append', kernel_command_line,
201 '-no-reboot')
202 self.vm.launch()
203 self.wait_for_console_pattern('Boot successful.')
205 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
206 'BogoMIPS')
207 exec_command_and_wait_for_pattern(self, 'uname -a',
208 'Debian')
209 exec_command_and_wait_for_pattern(self, 'reboot',
210 'reboot: Restarting system')
211 # Wait for VM to shut down gracefully
212 self.vm.wait()
214 @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
215 def test_mips64el_malta_5KEc_cpio(self):
217 :avocado: tags=arch:mips64el
218 :avocado: tags=machine:malta
219 :avocado: tags=endian:little
221 kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
222 'raw/9ad2df38/mips/malta/mips64el/'
223 'vmlinux-3.19.3.mtoman.20150408')
224 kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
225 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
226 initrd_url = ('https://github.com/groeck/linux-build-test/'
227 'raw/8584a59e/rootfs/'
228 'mipsel64/rootfs.mipsel64r1.cpio.gz')
229 initrd_hash = '1dbb8a396e916847325284dbe2151167'
230 initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
231 asset_hash=initrd_hash)
232 initrd_path = self.workdir + "rootfs.cpio"
233 archive.gzip_uncompress(initrd_path_gz, initrd_path)
235 self.vm.set_console()
236 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
237 + 'console=ttyS0 console=tty '
238 + 'rdinit=/sbin/init noreboot')
239 self.vm.add_args('-cpu', '5KEc',
240 '-kernel', kernel_path,
241 '-initrd', initrd_path,
242 '-append', kernel_command_line,
243 '-no-reboot')
244 self.vm.launch()
245 wait_for_console_pattern(self, 'Boot successful.')
247 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
248 'MIPS 5KE')
249 exec_command_and_wait_for_pattern(self, 'uname -a',
250 '3.19.3.mtoman.20150408')
251 exec_command_and_wait_for_pattern(self, 'reboot',
252 'reboot: Restarting system')
253 # Wait for VM to shut down gracefully
254 self.vm.wait()
256 def do_test_mips_malta32el_nanomips(self, kernel_url, kernel_hash):
257 kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
258 kernel_path = self.workdir + "kernel"
259 with lzma.open(kernel_path_xz, 'rb') as f_in:
260 with open(kernel_path, 'wb') as f_out:
261 shutil.copyfileobj(f_in, f_out)
263 self.vm.set_console()
264 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE
265 + 'mem=256m@@0x0 '
266 + 'console=ttyS0')
267 self.vm.add_args('-no-reboot',
268 '-cpu', 'I7200',
269 '-kernel', kernel_path,
270 '-append', kernel_command_line)
271 self.vm.launch()
272 console_pattern = 'Kernel command line: %s' % kernel_command_line
273 self.wait_for_console_pattern(console_pattern)
275 def test_mips_malta32el_nanomips_4k(self):
277 :avocado: tags=arch:mipsel
278 :avocado: tags=machine:malta
279 :avocado: tags=endian:little
281 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
282 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
283 'generic_nano32r6el_page4k.xz')
284 kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
285 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
287 def test_mips_malta32el_nanomips_16k_up(self):
289 :avocado: tags=arch:mipsel
290 :avocado: tags=machine:malta
291 :avocado: tags=endian:little
293 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
294 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
295 'generic_nano32r6el_page16k_up.xz')
296 kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
297 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
299 def test_mips_malta32el_nanomips_64k_dbg(self):
301 :avocado: tags=arch:mipsel
302 :avocado: tags=machine:malta
303 :avocado: tags=endian:little
305 kernel_url = ('https://mipsdistros.mips.com/LinuxDistro/nanomips/'
306 'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
307 'generic_nano32r6el_page64k_dbg.xz')
308 kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
309 self.do_test_mips_malta32el_nanomips(kernel_url, kernel_hash)
311 def test_aarch64_virt(self):
313 :avocado: tags=arch:aarch64
314 :avocado: tags=machine:virt
316 kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
317 '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
318 '/vmlinuz')
319 kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
320 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
322 self.vm.set_console()
323 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
324 'console=ttyAMA0')
325 self.vm.add_args('-cpu', 'cortex-a53',
326 '-kernel', kernel_path,
327 '-append', kernel_command_line)
328 self.vm.launch()
329 console_pattern = 'Kernel command line: %s' % kernel_command_line
330 self.wait_for_console_pattern(console_pattern)
332 def test_aarch64_xlnx_versal_virt(self):
334 :avocado: tags=arch:aarch64
335 :avocado: tags=machine:xlnx-versal-virt
336 :avocado: tags=device:pl011
337 :avocado: tags=device:arm_gicv3
339 images_url = ('http://ports.ubuntu.com/ubuntu-ports/dists/'
340 'bionic-updates/main/installer-arm64/'
341 '20101020ubuntu543.15/images/')
342 kernel_url = images_url + 'netboot/ubuntu-installer/arm64/linux'
343 kernel_hash = '5bfc54cf7ed8157d93f6e5b0241e727b6dc22c50'
344 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
346 initrd_url = images_url + 'netboot/ubuntu-installer/arm64/initrd.gz'
347 initrd_hash = 'd385d3e88d53e2004c5d43cbe668b458a094f772'
348 initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
350 self.vm.set_console()
351 self.vm.add_args('-m', '2G',
352 '-kernel', kernel_path,
353 '-initrd', initrd_path)
354 self.vm.launch()
355 self.wait_for_console_pattern('Checked W+X mappings: passed')
357 def test_arm_virt(self):
359 :avocado: tags=arch:arm
360 :avocado: tags=machine:virt
362 kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
363 '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
364 '/vmlinuz')
365 kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
366 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
368 self.vm.set_console()
369 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
370 'console=ttyAMA0')
371 self.vm.add_args('-kernel', kernel_path,
372 '-append', kernel_command_line)
373 self.vm.launch()
374 console_pattern = 'Kernel command line: %s' % kernel_command_line
375 self.wait_for_console_pattern(console_pattern)
377 def test_arm_emcraft_sf2(self):
379 :avocado: tags=arch:arm
380 :avocado: tags=machine:emcraft-sf2
381 :avocado: tags=endian:little
382 :avocado: tags=u-boot
384 uboot_url = ('https://raw.githubusercontent.com/'
385 'Subbaraya-Sundeep/qemu-test-binaries/'
386 'fe371d32e50ca682391e1e70ab98c2942aeffb01/u-boot')
387 uboot_hash = 'cbb8cbab970f594bf6523b9855be209c08374ae2'
388 uboot_path = self.fetch_asset(uboot_url, asset_hash=uboot_hash)
389 spi_url = ('https://raw.githubusercontent.com/'
390 'Subbaraya-Sundeep/qemu-test-binaries/'
391 'fe371d32e50ca682391e1e70ab98c2942aeffb01/spi.bin')
392 spi_hash = '65523a1835949b6f4553be96dec1b6a38fb05501'
393 spi_path = self.fetch_asset(spi_url, asset_hash=spi_hash)
395 self.vm.set_console()
396 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
397 self.vm.add_args('-kernel', uboot_path,
398 '-append', kernel_command_line,
399 '-drive', 'file=' + spi_path + ',if=mtd,format=raw',
400 '-no-reboot')
401 self.vm.launch()
402 self.wait_for_console_pattern('Enter \'help\' for a list')
404 exec_command_and_wait_for_pattern(self, 'ifconfig eth0 10.0.2.15',
405 'eth0: link becomes ready')
406 exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2',
407 '3 packets transmitted, 3 packets received, 0% packet loss')
409 def do_test_arm_raspi2(self, uart_id):
411 The kernel can be rebuilt using the kernel source referenced
412 and following the instructions on the on:
413 https://www.raspberrypi.org/documentation/linux/kernel/building.md
415 serial_kernel_cmdline = {
416 0: 'earlycon=pl011,0x3f201000 console=ttyAMA0',
418 deb_url = ('http://archive.raspberrypi.org/debian/'
419 'pool/main/r/raspberrypi-firmware/'
420 'raspberrypi-kernel_1.20190215-1_armhf.deb')
421 deb_hash = 'cd284220b32128c5084037553db3c482426f3972'
422 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
423 kernel_path = self.extract_from_deb(deb_path, '/boot/kernel7.img')
424 dtb_path = self.extract_from_deb(deb_path, '/boot/bcm2709-rpi-2-b.dtb')
426 self.vm.set_console()
427 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
428 serial_kernel_cmdline[uart_id] +
429 ' root=/dev/mmcblk0p2 rootwait ' +
430 'dwc_otg.fiq_fsm_enable=0')
431 self.vm.add_args('-kernel', kernel_path,
432 '-dtb', dtb_path,
433 '-append', kernel_command_line,
434 '-device', 'usb-kbd')
435 self.vm.launch()
436 console_pattern = 'Kernel command line: %s' % kernel_command_line
437 self.wait_for_console_pattern(console_pattern)
438 console_pattern = 'Product: QEMU USB Keyboard'
439 self.wait_for_console_pattern(console_pattern)
441 def test_arm_raspi2_uart0(self):
443 :avocado: tags=arch:arm
444 :avocado: tags=machine:raspi2
445 :avocado: tags=device:pl011
447 self.do_test_arm_raspi2(0)
449 def test_arm_exynos4210_initrd(self):
451 :avocado: tags=arch:arm
452 :avocado: tags=machine:smdkc210
454 deb_url = ('https://snapshot.debian.org/archive/debian/'
455 '20190928T224601Z/pool/main/l/linux/'
456 'linux-image-4.19.0-6-armmp_4.19.67-2+deb10u1_armhf.deb')
457 deb_hash = 'fa9df4a0d38936cb50084838f2cb933f570d7d82'
458 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
459 kernel_path = self.extract_from_deb(deb_path,
460 '/boot/vmlinuz-4.19.0-6-armmp')
461 dtb_path = '/usr/lib/linux-image-4.19.0-6-armmp/exynos4210-smdkv310.dtb'
462 dtb_path = self.extract_from_deb(deb_path, dtb_path)
464 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
465 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
466 'arm/rootfs-armv5.cpio.gz')
467 initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
468 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
469 initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
470 archive.gzip_uncompress(initrd_path_gz, initrd_path)
472 self.vm.set_console()
473 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
474 'earlycon=exynos4210,0x13800000 earlyprintk ' +
475 'console=ttySAC0,115200n8 ' +
476 'random.trust_cpu=off cryptomgr.notests ' +
477 'cpuidle.off=1 panic=-1 noreboot')
479 self.vm.add_args('-kernel', kernel_path,
480 '-dtb', dtb_path,
481 '-initrd', initrd_path,
482 '-append', kernel_command_line,
483 '-no-reboot')
484 self.vm.launch()
486 self.wait_for_console_pattern('Boot successful.')
487 # TODO user command, for now the uart is stuck
489 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
490 'Test artifacts fetched from unreliable apt.armbian.com')
491 def test_arm_cubieboard_initrd(self):
493 :avocado: tags=arch:arm
494 :avocado: tags=machine:cubieboard
496 deb_url = ('https://apt.armbian.com/pool/main/l/'
497 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
498 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
499 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
500 kernel_path = self.extract_from_deb(deb_path,
501 '/boot/vmlinuz-4.20.7-sunxi')
502 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
503 dtb_path = self.extract_from_deb(deb_path, dtb_path)
504 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
505 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
506 'arm/rootfs-armv5.cpio.gz')
507 initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
508 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
509 initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
510 archive.gzip_uncompress(initrd_path_gz, initrd_path)
512 self.vm.set_console()
513 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
514 'console=ttyS0,115200 '
515 'usbcore.nousb '
516 'panic=-1 noreboot')
517 self.vm.add_args('-kernel', kernel_path,
518 '-dtb', dtb_path,
519 '-initrd', initrd_path,
520 '-append', kernel_command_line,
521 '-no-reboot')
522 self.vm.launch()
523 self.wait_for_console_pattern('Boot successful.')
525 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
526 'Allwinner sun4i/sun5i')
527 exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
528 'system-control@1c00000')
529 # cubieboard's reboot is not functioning; omit reboot test.
531 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
532 'Test artifacts fetched from unreliable apt.armbian.com')
533 def test_arm_cubieboard_sata(self):
535 :avocado: tags=arch:arm
536 :avocado: tags=machine:cubieboard
538 deb_url = ('https://apt.armbian.com/pool/main/l/'
539 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
540 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
541 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
542 kernel_path = self.extract_from_deb(deb_path,
543 '/boot/vmlinuz-4.20.7-sunxi')
544 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun4i-a10-cubieboard.dtb'
545 dtb_path = self.extract_from_deb(deb_path, dtb_path)
546 rootfs_url = ('https://github.com/groeck/linux-build-test/raw/'
547 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
548 'arm/rootfs-armv5.ext2.gz')
549 rootfs_hash = '093e89d2b4d982234bf528bc9fb2f2f17a9d1f93'
550 rootfs_path_gz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
551 rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
552 archive.gzip_uncompress(rootfs_path_gz, rootfs_path)
554 self.vm.set_console()
555 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
556 'console=ttyS0,115200 '
557 'usbcore.nousb '
558 'root=/dev/sda ro '
559 'panic=-1 noreboot')
560 self.vm.add_args('-kernel', kernel_path,
561 '-dtb', dtb_path,
562 '-drive', 'if=none,format=raw,id=disk0,file='
563 + rootfs_path,
564 '-device', 'ide-hd,bus=ide.0,drive=disk0',
565 '-append', kernel_command_line,
566 '-no-reboot')
567 self.vm.launch()
568 self.wait_for_console_pattern('Boot successful.')
570 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
571 'Allwinner sun4i/sun5i')
572 exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
573 'sda')
574 # cubieboard's reboot is not functioning; omit reboot test.
576 @skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
577 def test_arm_quanta_gsj(self):
579 :avocado: tags=arch:arm
580 :avocado: tags=machine:quanta-gsj
582 # 25 MiB compressed, 32 MiB uncompressed.
583 image_url = (
584 'https://github.com/hskinnemoen/openbmc/releases/download/'
585 '20200711-gsj-qemu-0/obmc-phosphor-image-gsj.static.mtd.gz')
586 image_hash = '14895e634923345cb5c8776037ff7876df96f6b1'
587 image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
588 image_name = 'obmc.mtd'
589 image_path = os.path.join(self.workdir, image_name)
590 archive.gzip_uncompress(image_path_gz, image_path)
592 self.vm.set_console()
593 drive_args = 'file=' + image_path + ',if=mtd,bus=0,unit=0'
594 self.vm.add_args('-drive', drive_args)
595 self.vm.launch()
597 # Disable drivers and services that stall for a long time during boot,
598 # to avoid running past the 90-second timeout. These may be removed
599 # as the corresponding device support is added.
600 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + (
601 'console=${console} '
602 'mem=${mem} '
603 'initcall_blacklist=npcm_i2c_bus_driver_init '
604 'systemd.mask=systemd-random-seed.service '
605 'systemd.mask=dropbearkey.service '
608 self.wait_for_console_pattern('> BootBlock by Nuvoton')
609 self.wait_for_console_pattern('>Device: Poleg BMC NPCM730')
610 self.wait_for_console_pattern('>Skip DDR init.')
611 self.wait_for_console_pattern('U-Boot ')
612 interrupt_interactive_console_until_pattern(
613 self, 'Hit any key to stop autoboot:', 'U-Boot>')
614 exec_command_and_wait_for_pattern(
615 self, "setenv bootargs ${bootargs} " + kernel_command_line,
616 'U-Boot>')
617 exec_command_and_wait_for_pattern(
618 self, 'run romboot', 'Booting Kernel from flash')
619 self.wait_for_console_pattern('Booting Linux on physical CPU 0x0')
620 self.wait_for_console_pattern('CPU1: thread -1, cpu 1, socket 0')
621 self.wait_for_console_pattern('OpenBMC Project Reference Distro')
622 self.wait_for_console_pattern('gsj login:')
624 def test_arm_quanta_gsj_initrd(self):
626 :avocado: tags=arch:arm
627 :avocado: tags=machine:quanta-gsj
629 initrd_url = (
630 'https://github.com/hskinnemoen/openbmc/releases/download/'
631 '20200711-gsj-qemu-0/obmc-phosphor-initramfs-gsj.cpio.xz')
632 initrd_hash = '98fefe5d7e56727b1eb17d5c00311b1b5c945300'
633 initrd_path = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
634 kernel_url = (
635 'https://github.com/hskinnemoen/openbmc/releases/download/'
636 '20200711-gsj-qemu-0/uImage-gsj.bin')
637 kernel_hash = 'fa67b2f141d56d39b3c54305c0e8a899c99eb2c7'
638 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
639 dtb_url = (
640 'https://github.com/hskinnemoen/openbmc/releases/download/'
641 '20200711-gsj-qemu-0/nuvoton-npcm730-gsj.dtb')
642 dtb_hash = '18315f7006d7b688d8312d5c727eecd819aa36a4'
643 dtb_path = self.fetch_asset(dtb_url, asset_hash=dtb_hash)
645 self.vm.set_console()
646 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
647 'console=ttyS0,115200n8 '
648 'earlycon=uart8250,mmio32,0xf0001000')
649 self.vm.add_args('-kernel', kernel_path,
650 '-initrd', initrd_path,
651 '-dtb', dtb_path,
652 '-append', kernel_command_line)
653 self.vm.launch()
655 self.wait_for_console_pattern('Booting Linux on physical CPU 0x0')
656 self.wait_for_console_pattern('CPU1: thread -1, cpu 1, socket 0')
657 self.wait_for_console_pattern(
658 'Give root password for system maintenance')
660 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
661 'Test artifacts fetched from unreliable apt.armbian.com')
662 def test_arm_orangepi(self):
664 :avocado: tags=arch:arm
665 :avocado: tags=machine:orangepi-pc
667 deb_url = ('https://apt.armbian.com/pool/main/l/'
668 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
669 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
670 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
671 kernel_path = self.extract_from_deb(deb_path,
672 '/boot/vmlinuz-4.20.7-sunxi')
673 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
674 dtb_path = self.extract_from_deb(deb_path, dtb_path)
676 self.vm.set_console()
677 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
678 'console=ttyS0,115200n8 '
679 'earlycon=uart,mmio32,0x1c28000')
680 self.vm.add_args('-kernel', kernel_path,
681 '-dtb', dtb_path,
682 '-append', kernel_command_line)
683 self.vm.launch()
684 console_pattern = 'Kernel command line: %s' % kernel_command_line
685 self.wait_for_console_pattern(console_pattern)
687 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
688 'Test artifacts fetched from unreliable apt.armbian.com')
689 def test_arm_orangepi_initrd(self):
691 :avocado: tags=arch:arm
692 :avocado: tags=machine:orangepi-pc
694 deb_url = ('https://apt.armbian.com/pool/main/l/'
695 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
696 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
697 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
698 kernel_path = self.extract_from_deb(deb_path,
699 '/boot/vmlinuz-4.20.7-sunxi')
700 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
701 dtb_path = self.extract_from_deb(deb_path, dtb_path)
702 initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
703 '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
704 'arm/rootfs-armv7a.cpio.gz')
705 initrd_hash = '604b2e45cdf35045846b8bbfbf2129b1891bdc9c'
706 initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
707 initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
708 archive.gzip_uncompress(initrd_path_gz, initrd_path)
710 self.vm.set_console()
711 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
712 'console=ttyS0,115200 '
713 'panic=-1 noreboot')
714 self.vm.add_args('-kernel', kernel_path,
715 '-dtb', dtb_path,
716 '-initrd', initrd_path,
717 '-append', kernel_command_line,
718 '-no-reboot')
719 self.vm.launch()
720 self.wait_for_console_pattern('Boot successful.')
722 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
723 'Allwinner sun8i Family')
724 exec_command_and_wait_for_pattern(self, 'cat /proc/iomem',
725 'system-control@1c00000')
726 exec_command_and_wait_for_pattern(self, 'reboot',
727 'reboot: Restarting system')
728 # Wait for VM to shut down gracefully
729 self.vm.wait()
731 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
732 'Test artifacts fetched from unreliable apt.armbian.com')
733 def test_arm_orangepi_sd(self):
735 :avocado: tags=arch:arm
736 :avocado: tags=machine:orangepi-pc
737 :avocado: tags=device:sd
739 deb_url = ('https://apt.armbian.com/pool/main/l/'
740 'linux-4.20.7-sunxi/linux-image-dev-sunxi_5.75_armhf.deb')
741 deb_hash = '1334c29c44d984ffa05ed10de8c3361f33d78315'
742 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
743 kernel_path = self.extract_from_deb(deb_path,
744 '/boot/vmlinuz-4.20.7-sunxi')
745 dtb_path = '/usr/lib/linux-image-dev-sunxi/sun8i-h3-orangepi-pc.dtb'
746 dtb_path = self.extract_from_deb(deb_path, dtb_path)
747 rootfs_url = ('http://storage.kernelci.org/images/rootfs/buildroot/'
748 'kci-2019.02/armel/base/rootfs.ext2.xz')
749 rootfs_hash = '692510cb625efda31640d1de0a8d60e26040f061'
750 rootfs_path_xz = self.fetch_asset(rootfs_url, asset_hash=rootfs_hash)
751 rootfs_path = os.path.join(self.workdir, 'rootfs.cpio')
752 archive.lzma_uncompress(rootfs_path_xz, rootfs_path)
753 image_pow2ceil_expand(rootfs_path)
755 self.vm.set_console()
756 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
757 'console=ttyS0,115200 '
758 'root=/dev/mmcblk0 rootwait rw '
759 'panic=-1 noreboot')
760 self.vm.add_args('-kernel', kernel_path,
761 '-dtb', dtb_path,
762 '-drive', 'file=' + rootfs_path + ',if=sd,format=raw',
763 '-append', kernel_command_line,
764 '-no-reboot')
765 self.vm.launch()
766 shell_ready = "/bin/sh: can't access tty; job control turned off"
767 self.wait_for_console_pattern(shell_ready)
769 exec_command_and_wait_for_pattern(self, 'cat /proc/cpuinfo',
770 'Allwinner sun8i Family')
771 exec_command_and_wait_for_pattern(self, 'cat /proc/partitions',
772 'mmcblk0')
773 exec_command_and_wait_for_pattern(self, 'ifconfig eth0 up',
774 'eth0: Link is Up')
775 exec_command_and_wait_for_pattern(self, 'udhcpc eth0',
776 'udhcpc: lease of 10.0.2.15 obtained')
777 exec_command_and_wait_for_pattern(self, 'ping -c 3 10.0.2.2',
778 '3 packets transmitted, 3 packets received, 0% packet loss')
779 exec_command_and_wait_for_pattern(self, 'reboot',
780 'reboot: Restarting system')
781 # Wait for VM to shut down gracefully
782 self.vm.wait()
784 @skipUnless(os.getenv('ARMBIAN_ARTIFACTS_CACHED'),
785 'Test artifacts fetched from unreliable dl.armbian.com')
786 @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
787 @skipUnless(P7ZIP_AVAILABLE, '7z not installed')
788 def test_arm_orangepi_bionic(self):
790 :avocado: tags=arch:arm
791 :avocado: tags=machine:orangepi-pc
792 :avocado: tags=device:sd
795 # This test download a 196MB compressed image and expand it to 1GB
796 image_url = ('https://dl.armbian.com/orangepipc/archive/'
797 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.7z')
798 image_hash = '196a8ffb72b0123d92cea4a070894813d305c71e'
799 image_path_7z = self.fetch_asset(image_url, asset_hash=image_hash)
800 image_name = 'Armbian_19.11.3_Orangepipc_bionic_current_5.3.9.img'
801 image_path = os.path.join(self.workdir, image_name)
802 process.run("7z e -o%s %s" % (self.workdir, image_path_7z))
803 image_pow2ceil_expand(image_path)
805 self.vm.set_console()
806 self.vm.add_args('-drive', 'file=' + image_path + ',if=sd,format=raw',
807 '-nic', 'user',
808 '-no-reboot')
809 self.vm.launch()
811 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
812 'console=ttyS0,115200 '
813 'loglevel=7 '
814 'nosmp '
815 'systemd.default_timeout_start_sec=9000 '
816 'systemd.mask=armbian-zram-config.service '
817 'systemd.mask=armbian-ramlog.service')
819 self.wait_for_console_pattern('U-Boot SPL')
820 self.wait_for_console_pattern('Autoboot in ')
821 exec_command_and_wait_for_pattern(self, ' ', '=>')
822 exec_command_and_wait_for_pattern(self, "setenv extraargs '" +
823 kernel_command_line + "'", '=>')
824 exec_command_and_wait_for_pattern(self, 'boot', 'Starting kernel ...');
826 self.wait_for_console_pattern('systemd[1]: Set hostname ' +
827 'to <orangepipc>')
828 self.wait_for_console_pattern('Starting Load Kernel Modules...')
830 @skipUnless(os.getenv('AVOCADO_ALLOW_LARGE_STORAGE'), 'storage limited')
831 def test_arm_orangepi_uboot_netbsd9(self):
833 :avocado: tags=arch:arm
834 :avocado: tags=machine:orangepi-pc
835 :avocado: tags=device:sd
837 # This test download a 304MB compressed image and expand it to 2GB
838 deb_url = ('http://snapshot.debian.org/archive/debian/'
839 '20200108T145233Z/pool/main/u/u-boot/'
840 'u-boot-sunxi_2020.01%2Bdfsg-1_armhf.deb')
841 deb_hash = 'f67f404a80753ca3d1258f13e38f2b060e13db99'
842 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
843 # We use the common OrangePi PC 'plus' build of U-Boot for our secondary
844 # program loader (SPL). We will then set the path to the more specific
845 # OrangePi "PC" device tree blob with 'setenv fdtfile' in U-Boot prompt,
846 # before to boot NetBSD.
847 uboot_path = '/usr/lib/u-boot/orangepi_plus/u-boot-sunxi-with-spl.bin'
848 uboot_path = self.extract_from_deb(deb_path, uboot_path)
849 image_url = ('https://cdn.netbsd.org/pub/NetBSD/NetBSD-9.0/'
850 'evbarm-earmv7hf/binary/gzimg/armv7.img.gz')
851 image_hash = '2babb29d36d8360adcb39c09e31060945259917a'
852 image_path_gz = self.fetch_asset(image_url, asset_hash=image_hash)
853 image_path = os.path.join(self.workdir, 'armv7.img')
854 archive.gzip_uncompress(image_path_gz, image_path)
855 image_pow2ceil_expand(image_path)
856 image_drive_args = 'if=sd,format=raw,snapshot=on,file=' + image_path
858 # dd if=u-boot-sunxi-with-spl.bin of=armv7.img bs=1K seek=8 conv=notrunc
859 with open(uboot_path, 'rb') as f_in:
860 with open(image_path, 'r+b') as f_out:
861 f_out.seek(8 * 1024)
862 shutil.copyfileobj(f_in, f_out)
864 self.vm.set_console()
865 self.vm.add_args('-nic', 'user',
866 '-drive', image_drive_args,
867 '-global', 'allwinner-rtc.base-year=2000',
868 '-no-reboot')
869 self.vm.launch()
870 wait_for_console_pattern(self, 'U-Boot 2020.01+dfsg-1')
871 interrupt_interactive_console_until_pattern(self,
872 'Hit any key to stop autoboot:',
873 'switch to partitions #0, OK')
875 exec_command_and_wait_for_pattern(self, '', '=>')
876 cmd = 'setenv bootargs root=ld0a'
877 exec_command_and_wait_for_pattern(self, cmd, '=>')
878 cmd = 'setenv kernel netbsd-GENERIC.ub'
879 exec_command_and_wait_for_pattern(self, cmd, '=>')
880 cmd = 'setenv fdtfile dtb/sun8i-h3-orangepi-pc.dtb'
881 exec_command_and_wait_for_pattern(self, cmd, '=>')
882 cmd = ("setenv bootcmd 'fatload mmc 0:1 ${kernel_addr_r} ${kernel}; "
883 "fatload mmc 0:1 ${fdt_addr_r} ${fdtfile}; "
884 "fdt addr ${fdt_addr_r}; "
885 "bootm ${kernel_addr_r} - ${fdt_addr_r}'")
886 exec_command_and_wait_for_pattern(self, cmd, '=>')
888 exec_command_and_wait_for_pattern(self, 'boot',
889 'Booting kernel from Legacy Image')
890 wait_for_console_pattern(self, 'Starting kernel ...')
891 wait_for_console_pattern(self, 'NetBSD 9.0 (GENERIC)')
892 # Wait for user-space
893 wait_for_console_pattern(self, 'Starting root file system check')
895 def test_aarch64_raspi3_atf(self):
897 :avocado: tags=arch:aarch64
898 :avocado: tags=machine:raspi3
899 :avocado: tags=cpu:cortex-a53
900 :avocado: tags=device:pl011
901 :avocado: tags=atf
903 zip_url = ('https://github.com/pbatard/RPi3/releases/download/'
904 'v1.15/RPi3_UEFI_Firmware_v1.15.zip')
905 zip_hash = '74b3bd0de92683cadb14e008a7575e1d0c3cafb9'
906 zip_path = self.fetch_asset(zip_url, asset_hash=zip_hash)
908 archive.extract(zip_path, self.workdir)
909 efi_fd = os.path.join(self.workdir, 'RPI_EFI.fd')
911 self.vm.set_console(console_index=1)
912 self.vm.add_args('-nodefaults',
913 '-device', 'loader,file=%s,force-raw=true' % efi_fd)
914 self.vm.launch()
915 self.wait_for_console_pattern('version UEFI Firmware v1.15')
917 def test_s390x_s390_ccw_virtio(self):
919 :avocado: tags=arch:s390x
920 :avocado: tags=machine:s390-ccw-virtio
922 kernel_url = ('https://archives.fedoraproject.org/pub/archive'
923 '/fedora-secondary/releases/29/Everything/s390x/os/images'
924 '/kernel.img')
925 kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313'
926 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
928 self.vm.set_console()
929 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0'
930 self.vm.add_args('-nodefaults',
931 '-kernel', kernel_path,
932 '-append', kernel_command_line)
933 self.vm.launch()
934 console_pattern = 'Kernel command line: %s' % kernel_command_line
935 self.wait_for_console_pattern(console_pattern)
937 def test_alpha_clipper(self):
939 :avocado: tags=arch:alpha
940 :avocado: tags=machine:clipper
942 kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/'
943 'installer-alpha/20090123lenny10/images/cdrom/vmlinuz')
944 kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3'
945 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
947 uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
949 self.vm.set_console()
950 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
951 self.vm.add_args('-nodefaults',
952 '-kernel', uncompressed_kernel,
953 '-append', kernel_command_line)
954 self.vm.launch()
955 console_pattern = 'Kernel command line: %s' % kernel_command_line
956 self.wait_for_console_pattern(console_pattern)
958 def test_ppc64_pseries(self):
960 :avocado: tags=arch:ppc64
961 :avocado: tags=machine:pseries
963 kernel_url = ('https://archives.fedoraproject.org/pub/archive'
964 '/fedora-secondary/releases/29/Everything/ppc64le/os'
965 '/ppc/ppc64/vmlinuz')
966 kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
967 kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
969 self.vm.set_console()
970 kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
971 self.vm.add_args('-kernel', kernel_path,
972 '-append', kernel_command_line)
973 self.vm.launch()
974 console_pattern = 'Kernel command line: %s' % kernel_command_line
975 self.wait_for_console_pattern(console_pattern)
977 def test_m68k_q800(self):
979 :avocado: tags=arch:m68k
980 :avocado: tags=machine:q800
982 deb_url = ('https://snapshot.debian.org/archive/debian-ports'
983 '/20191021T083923Z/pool-m68k/main'
984 '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
985 deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
986 deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
987 kernel_path = self.extract_from_deb(deb_path,
988 '/boot/vmlinux-5.3.0-1-m68k')
990 self.vm.set_console()
991 kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
992 'console=ttyS0 vga=off')
993 self.vm.add_args('-kernel', kernel_path,
994 '-append', kernel_command_line)
995 self.vm.launch()
996 console_pattern = 'Kernel command line: %s' % kernel_command_line
997 self.wait_for_console_pattern(console_pattern)
998 console_pattern = 'No filesystem could mount root'
999 self.wait_for_console_pattern(console_pattern)
1001 def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
1002 tar_url = ('https://www.qemu-advent-calendar.org'
1003 '/2018/download/day' + day + '.tar.xz')
1004 file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
1005 archive.extract(file_path, self.workdir)
1006 self.vm.set_console(console_index=console)
1007 self.vm.add_args('-kernel',
1008 self.workdir + '/day' + day + '/' + kernel_name)
1009 self.vm.launch()
1010 self.wait_for_console_pattern('QEMU advent calendar')
1012 def test_arm_vexpressa9(self):
1014 :avocado: tags=arch:arm
1015 :avocado: tags=machine:vexpress-a9
1017 tar_hash = '32b7677ce8b6f1471fb0059865f451169934245b'
1018 self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb')
1019 self.do_test_advcal_2018('16', tar_hash, 'winter.zImage')
1021 def test_m68k_mcf5208evb(self):
1023 :avocado: tags=arch:m68k
1024 :avocado: tags=machine:mcf5208evb
1026 tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
1027 self.do_test_advcal_2018('07', tar_hash, 'sanity-clause.elf')
1029 @skip("Test currently broken") # Console stuck as of 5.2-rc1
1030 def test_microblaze_s3adsp1800(self):
1032 :avocado: tags=arch:microblaze
1033 :avocado: tags=machine:petalogix-s3adsp1800
1035 tar_hash = '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f'
1036 self.do_test_advcal_2018('17', tar_hash, 'ballerina.bin')
1038 def test_or1k_sim(self):
1040 :avocado: tags=arch:or1k
1041 :avocado: tags=machine:or1k-sim
1043 tar_hash = '20334cdaf386108c530ff0badaecc955693027dd'
1044 self.do_test_advcal_2018('20', tar_hash, 'vmlinux')
1046 def test_nios2_10m50(self):
1048 :avocado: tags=arch:nios2
1049 :avocado: tags=machine:10m50-ghrd
1051 tar_hash = 'e4251141726c412ac0407c5a6bceefbbff018918'
1052 self.do_test_advcal_2018('14', tar_hash, 'vmlinux.elf')
1054 def test_ppc64_e500(self):
1056 :avocado: tags=arch:ppc64
1057 :avocado: tags=machine:ppce500
1059 tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
1060 self.vm.add_args('-cpu', 'e5500')
1061 self.do_test_advcal_2018('19', tar_hash, 'uImage')
1063 def test_ppc_g3beige(self):
1065 :avocado: tags=arch:ppc
1066 :avocado: tags=machine:g3beige
1068 tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
1069 self.vm.add_args('-M', 'graphics=off')
1070 self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
1072 def test_ppc_mac99(self):
1074 :avocado: tags=arch:ppc
1075 :avocado: tags=machine:mac99
1077 tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
1078 self.vm.add_args('-M', 'graphics=off')
1079 self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
1081 def test_sh4_r2d(self):
1083 :avocado: tags=arch:sh4
1084 :avocado: tags=machine:r2d
1086 tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
1087 self.vm.add_args('-append', 'console=ttySC1')
1088 self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
1090 def test_sparc_ss20(self):
1092 :avocado: tags=arch:sparc
1093 :avocado: tags=machine:SS-20
1095 tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
1096 self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
1098 def test_xtensa_lx60(self):
1100 :avocado: tags=arch:xtensa
1101 :avocado: tags=machine:lx60
1103 tar_hash = '49e88d9933742f0164b60839886c9739cb7a0d34'
1104 self.vm.add_args('-cpu', 'dc233c')
1105 self.do_test_advcal_2018('02', tar_hash, 'santas-sleigh-ride.elf')