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