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