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