xref: /qemu/tests/avocado/replay_kernel.py (revision a1fadbcf)
1# Record/replay test that boots a Linux kernel
2#
3# Copyright (c) 2020 ISP RAS
4#
5# Author:
6#  Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
7#
8# This work is licensed under the terms of the GNU GPL, version 2 or
9# later.  See the COPYING file in the top-level directory.
10
11import os
12import lzma
13import shutil
14import logging
15import time
16
17from avocado import skip
18from avocado import skipIf
19from avocado import skipUnless
20from avocado_qemu import wait_for_console_pattern
21from avocado.utils import archive
22from avocado.utils import process
23from boot_linux_console import LinuxKernelTest
24
25class ReplayKernelBase(LinuxKernelTest):
26    """
27    Boots a Linux kernel in record mode and checks that the console
28    is operational and the kernel command line is properly passed
29    from QEMU to the kernel.
30    Then replays the same scenario and verifies, that QEMU correctly
31    terminates.
32    """
33
34    timeout = 120
35    KERNEL_COMMON_COMMAND_LINE = 'printk.time=1 panic=-1 '
36
37    def run_vm(self, kernel_path, kernel_command_line, console_pattern,
38               record, shift, args, replay_path):
39        # icount requires TCG to be available
40        self.require_accelerator('tcg')
41
42        logger = logging.getLogger('replay')
43        start_time = time.time()
44        vm = self.get_vm()
45        vm.set_console()
46        if record:
47            logger.info('recording the execution...')
48            mode = 'record'
49        else:
50            logger.info('replaying the execution...')
51            mode = 'replay'
52        vm.add_args('-icount', 'shift=%s,rr=%s,rrfile=%s' %
53                    (shift, mode, replay_path),
54                    '-kernel', kernel_path,
55                    '-append', kernel_command_line,
56                    '-net', 'none',
57                    '-no-reboot')
58        if args:
59            vm.add_args(*args)
60        vm.launch()
61        self.wait_for_console_pattern(console_pattern, vm)
62        if record:
63            vm.shutdown()
64            logger.info('finished the recording with log size %s bytes'
65                        % os.path.getsize(replay_path))
66        else:
67            vm.wait()
68            logger.info('successfully finished the replay')
69        elapsed = time.time() - start_time
70        logger.info('elapsed time %.2f sec' % elapsed)
71        return elapsed
72
73    def run_rr(self, kernel_path, kernel_command_line, console_pattern,
74               shift=7, args=None):
75        replay_path = os.path.join(self.workdir, 'replay.bin')
76        t1 = self.run_vm(kernel_path, kernel_command_line, console_pattern,
77                         True, shift, args, replay_path)
78        t2 = self.run_vm(kernel_path, kernel_command_line, console_pattern,
79                         False, shift, args, replay_path)
80        logger = logging.getLogger('replay')
81        logger.info('replay overhead {:.2%}'.format(t2 / t1 - 1))
82
83class ReplayKernelNormal(ReplayKernelBase):
84    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
85    def test_x86_64_pc(self):
86        """
87        :avocado: tags=arch:x86_64
88        :avocado: tags=machine:pc
89        """
90        kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
91                      '/linux/releases/29/Everything/x86_64/os/images/pxeboot'
92                      '/vmlinuz')
93        kernel_hash = '23bebd2680757891cf7adedb033532163a792495'
94        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
95
96        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
97        console_pattern = 'VFS: Cannot open root device'
98
99        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
100
101    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
102    def test_mips_malta(self):
103        """
104        :avocado: tags=arch:mips
105        :avocado: tags=machine:malta
106        :avocado: tags=endian:big
107        """
108        deb_url = ('http://snapshot.debian.org/archive/debian/'
109                   '20130217T032700Z/pool/main/l/linux-2.6/'
110                   'linux-image-2.6.32-5-4kc-malta_2.6.32-48_mips.deb')
111        deb_hash = 'a8cfc28ad8f45f54811fc6cf74fc43ffcfe0ba04'
112        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
113        kernel_path = self.extract_from_deb(deb_path,
114                                            '/boot/vmlinux-2.6.32-5-4kc-malta')
115        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
116        console_pattern = 'Kernel command line: %s' % kernel_command_line
117
118        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
119
120    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
121    def test_mips64el_malta(self):
122        """
123        This test requires the ar tool to extract "data.tar.gz" from
124        the Debian package.
125
126        The kernel can be rebuilt using this Debian kernel source [1] and
127        following the instructions on [2].
128
129        [1] http://snapshot.debian.org/package/linux-2.6/2.6.32-48/
130            #linux-source-2.6.32_2.6.32-48
131        [2] https://kernel-team.pages.debian.net/kernel-handbook/
132            ch-common-tasks.html#s-common-official
133
134        :avocado: tags=arch:mips64el
135        :avocado: tags=machine:malta
136        """
137        deb_url = ('http://snapshot.debian.org/archive/debian/'
138                   '20130217T032700Z/pool/main/l/linux-2.6/'
139                   'linux-image-2.6.32-5-5kc-malta_2.6.32-48_mipsel.deb')
140        deb_hash = '1aaec92083bf22fda31e0d27fa8d9a388e5fc3d5'
141        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
142        kernel_path = self.extract_from_deb(deb_path,
143                                            '/boot/vmlinux-2.6.32-5-5kc-malta')
144        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
145        console_pattern = 'Kernel command line: %s' % kernel_command_line
146        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
147
148    def test_aarch64_virt(self):
149        """
150        :avocado: tags=arch:aarch64
151        :avocado: tags=machine:virt
152        :avocado: tags=cpu:cortex-a53
153        """
154        kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
155                      '/linux/releases/29/Everything/aarch64/os/images/pxeboot'
156                      '/vmlinuz')
157        kernel_hash = '8c73e469fc6ea06a58dc83a628fc695b693b8493'
158        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
159
160        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
161                               'console=ttyAMA0')
162        console_pattern = 'VFS: Cannot open root device'
163
164        self.run_rr(kernel_path, kernel_command_line, console_pattern)
165
166    def test_arm_virt(self):
167        """
168        :avocado: tags=arch:arm
169        :avocado: tags=machine:virt
170        """
171        kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora'
172                      '/linux/releases/29/Everything/armhfp/os/images/pxeboot'
173                      '/vmlinuz')
174        kernel_hash = 'e9826d741b4fb04cadba8d4824d1ed3b7fb8b4d4'
175        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
176
177        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
178                               'console=ttyAMA0')
179        console_pattern = 'VFS: Cannot open root device'
180
181        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1)
182
183    @skipIf(os.getenv('GITLAB_CI'), 'Running on GitLab')
184    def test_arm_cubieboard_initrd(self):
185        """
186        :avocado: tags=arch:arm
187        :avocado: tags=machine:cubieboard
188        """
189        deb_url = ('https://apt.armbian.com/pool/main/l/'
190                   'linux-5.10.16-sunxi/linux-image-current-sunxi_21.02.2_armhf.deb')
191        deb_hash = '9fa84beda245cabf0b4fa84cf6eaa7738ead1da0'
192        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
193        kernel_path = self.extract_from_deb(deb_path,
194                                            '/boot/vmlinuz-5.10.16-sunxi')
195        dtb_path = '/usr/lib/linux-image-current-sunxi/sun4i-a10-cubieboard.dtb'
196        dtb_path = self.extract_from_deb(deb_path, dtb_path)
197        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
198                      '2eb0a73b5d5a28df3170c546ddaaa9757e1e0848/rootfs/'
199                      'arm/rootfs-armv5.cpio.gz')
200        initrd_hash = '2b50f1873e113523967806f4da2afe385462ff9b'
201        initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
202        initrd_path = os.path.join(self.workdir, 'rootfs.cpio')
203        archive.gzip_uncompress(initrd_path_gz, initrd_path)
204
205        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
206                               'console=ttyS0,115200 '
207                               'usbcore.nousb '
208                               'panic=-1 noreboot')
209        console_pattern = 'Boot successful.'
210        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=1,
211                    args=('-dtb', dtb_path,
212                          '-initrd', initrd_path,
213                          '-no-reboot'))
214
215    def test_s390x_s390_ccw_virtio(self):
216        """
217        :avocado: tags=arch:s390x
218        :avocado: tags=machine:s390-ccw-virtio
219        """
220        kernel_url = ('https://archives.fedoraproject.org/pub/archive'
221                      '/fedora-secondary/releases/29/Everything/s390x/os/images'
222                      '/kernel.img')
223        kernel_hash = 'e8e8439103ef8053418ef062644ffd46a7919313'
224        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
225
226        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=sclp0'
227        console_pattern = 'Kernel command line: %s' % kernel_command_line
228        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=9)
229
230    def test_alpha_clipper(self):
231        """
232        :avocado: tags=arch:alpha
233        :avocado: tags=machine:clipper
234        """
235        kernel_url = ('http://archive.debian.org/debian/dists/lenny/main/'
236                      'installer-alpha/20090123lenny10/images/cdrom/vmlinuz')
237        kernel_hash = '3a943149335529e2ed3e74d0d787b85fb5671ba3'
238        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
239
240        uncompressed_kernel = archive.uncompress(kernel_path, self.workdir)
241
242        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=ttyS0'
243        console_pattern = 'Kernel command line: %s' % kernel_command_line
244        self.run_rr(uncompressed_kernel, kernel_command_line, console_pattern, shift=9,
245            args=('-nodefaults', ))
246
247    def test_ppc64_pseries(self):
248        """
249        :avocado: tags=arch:ppc64
250        :avocado: tags=machine:pseries
251        :avocado: tags=accel:tcg
252        """
253        kernel_url = ('https://archives.fedoraproject.org/pub/archive'
254                      '/fedora-secondary/releases/29/Everything/ppc64le/os'
255                      '/ppc/ppc64/vmlinuz')
256        kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
257        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
258
259        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + 'console=hvc0'
260        console_pattern = 'VFS: Cannot open root device'
261        self.run_rr(kernel_path, kernel_command_line, console_pattern)
262
263    def test_ppc64_powernv(self):
264        """
265        :avocado: tags=arch:ppc64
266        :avocado: tags=machine:powernv
267        :avocado: tags=accel:tcg
268        """
269        kernel_url = ('https://archives.fedoraproject.org/pub/archive'
270                      '/fedora-secondary/releases/29/Everything/ppc64le/os'
271                      '/ppc/ppc64/vmlinuz')
272        kernel_hash = '3fe04abfc852b66653b8c3c897a59a689270bc77'
273        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
274
275        kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE + \
276                              'console=tty0 console=hvc0'
277        console_pattern = 'VFS: Cannot open root device'
278        self.run_rr(kernel_path, kernel_command_line, console_pattern)
279
280    def test_m68k_q800(self):
281        """
282        :avocado: tags=arch:m68k
283        :avocado: tags=machine:q800
284        """
285        deb_url = ('https://snapshot.debian.org/archive/debian-ports'
286                   '/20191021T083923Z/pool-m68k/main'
287                   '/l/linux/kernel-image-5.3.0-1-m68k-di_5.3.7-1_m68k.udeb')
288        deb_hash = '044954bb9be4160a3ce81f8bc1b5e856b75cccd1'
289        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
290        kernel_path = self.extract_from_deb(deb_path,
291                                            '/boot/vmlinux-5.3.0-1-m68k')
292
293        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
294                               'console=ttyS0 vga=off')
295        console_pattern = 'No filesystem could mount root'
296        self.run_rr(kernel_path, kernel_command_line, console_pattern)
297
298    def do_test_advcal_2018(self, file_path, kernel_name, args=None):
299        archive.extract(file_path, self.workdir)
300
301        for entry in os.scandir(self.workdir):
302            if entry.name.startswith('day') and entry.is_dir():
303                kernel_path = os.path.join(entry.path, kernel_name)
304                break
305
306        kernel_command_line = ''
307        console_pattern = 'QEMU advent calendar'
308        self.run_rr(kernel_path, kernel_command_line, console_pattern,
309                    args=args)
310
311    def test_arm_vexpressa9(self):
312        """
313        :avocado: tags=arch:arm
314        :avocado: tags=machine:vexpress-a9
315        """
316        tar_hash = '32b7677ce8b6f1471fb0059865f451169934245b'
317        tar_url = ('https://qemu-advcal.gitlab.io'
318                   '/qac-best-of-multiarch/download/day16.tar.xz')
319        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
320        dtb_path = self.workdir + '/day16/vexpress-v2p-ca9.dtb'
321        self.do_test_advcal_2018(file_path, 'winter.zImage',
322                                 args=('-dtb', dtb_path))
323
324    def test_m68k_mcf5208evb(self):
325        """
326        :avocado: tags=arch:m68k
327        :avocado: tags=machine:mcf5208evb
328        """
329        tar_hash = 'ac688fd00561a2b6ce1359f9ff6aa2b98c9a570c'
330        tar_url = ('https://qemu-advcal.gitlab.io'
331                   '/qac-best-of-multiarch/download/day07.tar.xz')
332        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
333        self.do_test_advcal_2018(file_path, 'sanity-clause.elf')
334
335    @skip("Test currently broken") # Console stuck as of 5.2-rc1
336    def test_microblaze_s3adsp1800(self):
337        """
338        :avocado: tags=arch:microblaze
339        :avocado: tags=machine:petalogix-s3adsp1800
340        """
341        tar_hash = '08bf3e3bfb6b6c7ce1e54ab65d54e189f2caf13f'
342        tar_url = ('https://qemu-advcal.gitlab.io'
343                   '/qac-best-of-multiarch/download/day17.tar.xz')
344        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
345        self.do_test_advcal_2018(file_path, 'ballerina.bin')
346
347    def test_ppc64_e500(self):
348        """
349        :avocado: tags=arch:ppc64
350        :avocado: tags=machine:ppce500
351        :avocado: tags=cpu:e5500
352        """
353        tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
354        tar_url = ('https://qemu-advcal.gitlab.io'
355                   '/qac-best-of-multiarch/download/day19.tar.xz')
356        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
357        self.do_test_advcal_2018(file_path, 'uImage')
358
359    def test_or1k_sim(self):
360        """
361        :avocado: tags=arch:or1k
362        :avocado: tags=machine:or1k-sim
363        """
364        tar_hash = '20334cdaf386108c530ff0badaecc955693027dd'
365        tar_url = ('https://qemu-advcal.gitlab.io'
366                   '/qac-best-of-multiarch/download/day20.tar.xz')
367        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
368        self.do_test_advcal_2018(file_path, 'vmlinux')
369
370    @skip("nios2 emulation is buggy under record/replay")
371    def test_nios2_10m50(self):
372        """
373        :avocado: tags=arch:nios2
374        :avocado: tags=machine:10m50-ghrd
375        """
376        tar_hash = 'e4251141726c412ac0407c5a6bceefbbff018918'
377        tar_url = ('https://qemu-advcal.gitlab.io'
378                   '/qac-best-of-multiarch/download/day14.tar.xz')
379        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
380        self.do_test_advcal_2018(file_path, 'vmlinux.elf')
381
382    def test_ppc_g3beige(self):
383        """
384        :avocado: tags=arch:ppc
385        :avocado: tags=machine:g3beige
386        """
387        tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
388        tar_url = ('https://qemu-advcal.gitlab.io'
389                   '/qac-best-of-multiarch/download/day15.tar.xz')
390        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
391        self.do_test_advcal_2018(file_path, 'invaders.elf',
392                                 args=('-M', 'graphics=off'))
393
394    def test_ppc_mac99(self):
395        """
396        :avocado: tags=arch:ppc
397        :avocado: tags=machine:mac99
398        """
399        tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
400        tar_url = ('https://qemu-advcal.gitlab.io'
401                   '/qac-best-of-multiarch/download/day15.tar.xz')
402        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
403        self.do_test_advcal_2018(file_path, 'invaders.elf',
404                                 args=('-M', 'graphics=off'))
405
406    def test_sparc_ss20(self):
407        """
408        :avocado: tags=arch:sparc
409        :avocado: tags=machine:SS-20
410        """
411        tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
412        tar_url = ('https://qemu-advcal.gitlab.io'
413                   '/qac-best-of-multiarch/download/day11.tar.xz')
414        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
415        self.do_test_advcal_2018(file_path, 'zImage.elf')
416
417    def test_xtensa_lx60(self):
418        """
419        :avocado: tags=arch:xtensa
420        :avocado: tags=machine:lx60
421        :avocado: tags=cpu:dc233c
422        """
423        tar_hash = '49e88d9933742f0164b60839886c9739cb7a0d34'
424        tar_url = ('https://qemu-advcal.gitlab.io'
425                   '/qac-best-of-multiarch/download/day02.tar.xz')
426        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
427        self.do_test_advcal_2018(file_path, 'santas-sleigh-ride.elf')
428
429@skipUnless(os.getenv('AVOCADO_TIMEOUT_EXPECTED'), 'Test might timeout')
430class ReplayKernelSlow(ReplayKernelBase):
431    # Override the timeout, because this kernel includes an inner
432    # loop which is executed with TB recompilings during replay,
433    # making it very slow.
434    timeout = 180
435
436    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
437    def test_mips_malta_cpio(self):
438        """
439        :avocado: tags=arch:mips
440        :avocado: tags=machine:malta
441        :avocado: tags=endian:big
442        :avocado: tags=slowness:high
443        """
444        deb_url = ('http://snapshot.debian.org/archive/debian/'
445                   '20160601T041800Z/pool/main/l/linux/'
446                   'linux-image-4.5.0-2-4kc-malta_4.5.5-1_mips.deb')
447        deb_hash = 'a3c84f3e88b54e06107d65a410d1d1e8e0f340f8'
448        deb_path = self.fetch_asset(deb_url, asset_hash=deb_hash)
449        kernel_path = self.extract_from_deb(deb_path,
450                                            '/boot/vmlinux-4.5.0-2-4kc-malta')
451        initrd_url = ('https://github.com/groeck/linux-build-test/raw/'
452                      '8584a59ed9e5eb5ee7ca91f6d74bbb06619205b8/rootfs/'
453                      'mips/rootfs.cpio.gz')
454        initrd_hash = 'bf806e17009360a866bf537f6de66590de349a99'
455        initrd_path_gz = self.fetch_asset(initrd_url, asset_hash=initrd_hash)
456        initrd_path = self.workdir + "rootfs.cpio"
457        archive.gzip_uncompress(initrd_path_gz, initrd_path)
458
459        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
460                               'console=ttyS0 console=tty '
461                               'rdinit=/sbin/init noreboot')
462        console_pattern = 'Boot successful.'
463        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5,
464                    args=('-initrd', initrd_path))
465
466    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
467    @skipUnless(os.getenv('AVOCADO_ALLOW_UNTRUSTED_CODE'), 'untrusted code')
468    def test_mips64el_malta_5KEc_cpio(self):
469        """
470        :avocado: tags=arch:mips64el
471        :avocado: tags=machine:malta
472        :avocado: tags=endian:little
473        :avocado: tags=slowness:high
474        :avocado: tags=cpu:5KEc
475        """
476        kernel_url = ('https://github.com/philmd/qemu-testing-blob/'
477                      'raw/9ad2df38/mips/malta/mips64el/'
478                      'vmlinux-3.19.3.mtoman.20150408')
479        kernel_hash = '00d1d268fb9f7d8beda1de6bebcc46e884d71754'
480        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
481        initrd_url = ('https://github.com/groeck/linux-build-test/'
482                      'raw/8584a59e/rootfs/'
483                      'mipsel64/rootfs.mipsel64r1.cpio.gz')
484        initrd_hash = '1dbb8a396e916847325284dbe2151167'
485        initrd_path_gz = self.fetch_asset(initrd_url, algorithm='md5',
486                                          asset_hash=initrd_hash)
487        initrd_path = self.workdir + "rootfs.cpio"
488        archive.gzip_uncompress(initrd_path_gz, initrd_path)
489
490        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
491                               'console=ttyS0 console=tty '
492                               'rdinit=/sbin/init noreboot')
493        console_pattern = 'Boot successful.'
494        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5,
495                    args=('-initrd', initrd_path))
496
497    def do_test_mips_malta32el_nanomips(self, kernel_path_xz):
498        kernel_path = self.workdir + "kernel"
499        with lzma.open(kernel_path_xz, 'rb') as f_in:
500            with open(kernel_path, 'wb') as f_out:
501                shutil.copyfileobj(f_in, f_out)
502
503        kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE +
504                               'mem=256m@@0x0 '
505                               'console=ttyS0')
506        console_pattern = 'Kernel command line: %s' % kernel_command_line
507        self.run_rr(kernel_path, kernel_command_line, console_pattern, shift=5)
508
509    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
510    def test_mips_malta32el_nanomips_4k(self):
511        """
512        :avocado: tags=arch:mipsel
513        :avocado: tags=machine:malta
514        :avocado: tags=endian:little
515        :avocado: tags=cpu:I7200
516        """
517        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
518                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
519                      'generic_nano32r6el_page4k.xz')
520        kernel_hash = '477456aafd2a0f1ddc9482727f20fe9575565dd6'
521        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
522        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
523
524    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
525    def test_mips_malta32el_nanomips_16k_up(self):
526        """
527        :avocado: tags=arch:mipsel
528        :avocado: tags=machine:malta
529        :avocado: tags=endian:little
530        :avocado: tags=cpu:I7200
531        """
532        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
533                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
534                      'generic_nano32r6el_page16k_up.xz')
535        kernel_hash = 'e882868f944c71c816e832e2303b7874d044a7bc'
536        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
537        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
538
539    @skip('https://gitlab.com/qemu-project/qemu/-/issues/1884')
540    def test_mips_malta32el_nanomips_64k_dbg(self):
541        """
542        :avocado: tags=arch:mipsel
543        :avocado: tags=machine:malta
544        :avocado: tags=endian:little
545        :avocado: tags=cpu:I7200
546        """
547        kernel_url = ('http://mipsdistros.mips.com/LinuxDistro/nanomips/'
548                      'kernels/v4.15.18-432-gb2eb9a8b07a1-20180627102142/'
549                      'generic_nano32r6el_page64k_dbg.xz')
550        kernel_hash = '18d1c68f2e23429e266ca39ba5349ccd0aeb7180'
551        kernel_path_xz = self.fetch_asset(kernel_url, asset_hash=kernel_hash)
552        self.do_test_mips_malta32el_nanomips(kernel_path_xz)
553